OndrejKunc / SkiaScene

Simple API to transform SkiaSharp objects using functions like zoom and rotate or using gestures like pan and pinch.
MIT License
67 stars 18 forks source link

Touch does not register when Compile with .NET Native tool chain selected (Debug or Release) #6

Closed WillAutioItrax closed 5 years ago

WillAutioItrax commented 5 years ago

I have a simple demo that draws a background grid of lines. Then it waits for a click/touch on the grid. Expected behavior: When it gets a touch, it draws a fat black line of length 50. Observed behavior: If "Compile with .NET Native tool chain" is checked on in UWP->Properties->Build, nothing happens. If "Compile with .NET Native tool chain" is unchecked, then the line appears where the touch occurred.

The repro is at https://bitbucket.org/WillAutio/skiafail/src/master/ I took a previous repro and modified it to show this issue.

No rush - I am off for a few days. Have a good holidays! Thanks for looking at this.

OndrejKunc commented 5 years ago

It looks like a Xamarin.Forms issue, see this answer https://stackoverflow.com/a/44175300/1325023

Not sure if I can prevent this behavior on the library level.

However the fix is easy, just just provide explicit Assembly parameter to your Xamarin.Forms.Init method in App.Xaml.cs inside UWP project:

Xamarin.Forms.Forms.Init(e, new[] { typeof(TouchTracking.Forms.UWP.TouchEffect).Assembly });

Have a good holiday too!

WillAutioItrax commented 5 years ago

@OndrejKunc Excellent! Works like a charm.