Page 1 of 1

PointerRoutedEventArgs.Pointer is null?

Posted: Mon May 11, 2020 12:01 am
by takabo
Hi, I'm trying to create a custom control using Windows.UI.Xaml.Controls.Canvas.
I want to do something different with touch, mouse click, and pen.
So, I tried to use PointerRoutedEventArgs.Pointer.PointerDeviceType in PointerPressed event, but Pointer is null.

Is it impossible to judge touch or mouse click?

cshtml5 Ver: 2.0.0-alpha63-083

Re: PointerRoutedEventArgs.Pointer is null?

Posted: Mon May 11, 2020 1:13 am
by JS-Support @Userware
Hi,

The Pointer property is indeed never assigned at the moment:
https://github.com/OpenSilver/OpenSilve ... entArgs.cs

To add additional information such as the pointer type, one needs to retrieve it from "jsEventArg" (search for "jsEventArg" in the class above to see some examples).

Re: PointerRoutedEventArgs.Pointer is null?

Posted: Mon May 11, 2020 3:50 pm
by takabo
Thanks for the answer.
It seems difficult for me to fix it, so I give up.

Re: PointerRoutedEventArgs.Pointer is null?

Posted: Mon May 11, 2020 11:27 pm
by JS-Support @Userware
We have it on our backlog. Please stay tuned for updated. You may also vote for this feature on UserVoice, at:
https://cshtml5.uservoice.com/
Thanks