Question

I want to be able to detect if I have a pen close to the screen or not.
I would like for example to show a different appbar if I open it with a pen.
Also I would like to show other things on the screen when I hold a pen close to it (not necessarily touching it).

/Jimmy

Was it helpful?

Solution

When a pen or finger is near the screen, you will get a PointerEntered event. The PointerPressed event fires when the pen or finger makes contact. If the hardware does not support proximity, then the PointerEntered does not fire until contact is made, and it will be followed immediately by a PointerPressed.

OTHER TIPS

I figured it out.
I listen to the PointerEntered-event and PointerExited-event and then sets a variable that I can check in the appbar_opened-event.
Works great.

/Jimmy

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top