I know a SkiaSharp
canvas can be placed in a Grid
in a Xamarin App. Here is some example (working) code:
xmlns:skia="clr-namespace:SkiaSharp.Views.Forms;assembly=SkiaSharp.Views.Forms"
<skia:SKCanvasView
x:Name="AUView"
Grid.Row="2"
PaintSurface="AUView_PaintSurface" />
But when I try to do a similar thing in a WPF App:
xmlns:skia="clr-namespace:SkiaSharp;assembly=SkiaSharp"
<skia:SKCanvas
Name="AUView"
Grid.Row="2"
PaintSurface="AUView_PaintSurface" />
I get the error:
A value of type 'SKCanvas' cannot be added to a collection or dictionary of type 'UIElementCollection'.
Is it possible to put an SKCanvas
in a grid cell in WPF or does the whole of the page have to be an SKCanvas
?
Else, how/can you use SkiaSharp
in WPF?