-
Notifications
You must be signed in to change notification settings - Fork 1.6k
/
SkiaGraphicsViewHandler.cs
45 lines (40 loc) · 1.05 KB
/
SkiaGraphicsViewHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
/*
using Microsoft.Maui;
using Microsoft.Maui.Handlers;
#if !(NETSTANDARD || !PLATFORM)
using Microsoft.Maui.Graphics.Skia.Views;
#else
using SkiaGraphicsView = System.Object;
#endif
namespace Maui.Controls.Sample.Controls
{
public partial class SkiaGraphicsViewHandler : ViewHandler<IGraphicsView, SkiaGraphicsView>
{
public static IPropertyMapper<IGraphicsView, SkiaGraphicsViewHandler> GraphicsViewMapper =
new PropertyMapper<IGraphicsView, SkiaGraphicsViewHandler>(ViewHandler.ViewMapper)
{
[nameof(IGraphicsView.Drawable)] = MapDrawable
};
public SkiaGraphicsViewHandler()
: base(GraphicsViewMapper)
{
}
protected override SkiaGraphicsView CreatePlatformView()
{
#if __ANDROID__
return new SkiaGraphicsView(Context);
#elif TIZEN
return new SkiaGraphicsView(NativeParent);
#else
return new SkiaGraphicsView();
#endif
}
public static void MapDrawable(SkiaGraphicsViewHandler handler, IGraphicsView graphicsView)
{
#if !(NETSTANDARD || !PLATFORM)
handler.PlatformView.Drawable = graphicsView.Drawable;
#endif
}
}
}
*/