Image fixes
This commit is contained in:
@@ -24,6 +24,8 @@ public partial class ImageHandler : ViewHandler<IImage, SkiaImage>
|
||||
[nameof(IView.Background)] = MapBackground,
|
||||
["Width"] = MapWidth,
|
||||
["Height"] = MapHeight,
|
||||
["HorizontalOptions"] = MapHorizontalOptions,
|
||||
["VerticalOptions"] = MapVerticalOptions,
|
||||
};
|
||||
|
||||
public static CommandMapper<IImage, ImageHandler> CommandMapper = new(ViewHandler.ViewCommandMapper)
|
||||
@@ -148,6 +150,26 @@ public partial class ImageHandler : ViewHandler<IImage, SkiaImage>
|
||||
}
|
||||
}
|
||||
|
||||
public static void MapHorizontalOptions(ImageHandler handler, IImage image)
|
||||
{
|
||||
if (handler.PlatformView is null) return;
|
||||
|
||||
if (image is Image img)
|
||||
{
|
||||
handler.PlatformView.HorizontalOptions = img.HorizontalOptions;
|
||||
}
|
||||
}
|
||||
|
||||
public static void MapVerticalOptions(ImageHandler handler, IImage image)
|
||||
{
|
||||
if (handler.PlatformView is null) return;
|
||||
|
||||
if (image is Image img)
|
||||
{
|
||||
handler.PlatformView.VerticalOptions = img.VerticalOptions;
|
||||
}
|
||||
}
|
||||
|
||||
// Image source loading helper
|
||||
private ImageSourceServiceResultManager _sourceLoader = null!;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user