I am not able to make PointerPressed, PointerReleased (any pointer event) work.
I have written this line of code to support touch
inkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.Mouse | CoreInputDeviceTypes.Touch;
from the solutions that I found online, I have tried this
inkCanvas.PointerReleased += inkCanvas_PointerReleased;
and this
inkCanvas.AddHandler(PointerReleasedEvent, new PointerEventHandler(inkCanvas_PointerReleased), true);
and simply through XAML as well:
<InkCanvas x:Name="inkCanvas"
PointerPressed="inkCanvas_PointerPressed"
PointerMoved="inkCanvas_PointerMoved" PointerReleased="inkCanvas_PointerReleased"
Tapped="inkCanvas_Tapped">
I am testing the app in my device (not on emulator). what is it that I am missing?
There are few things to consider. First When you declare InkCanvas you need to Let the UIElement know what input type it can expect. There are 3 commonly used types.
So you need to make sure these are declared on your InkCanvas.
Once done, see if your pointerevents are fired when called from XAML. If it still does not work, Try below.
Edit 2: Below are the methods for all 3 actions
Hope this helps.