Is there an easy way to handle Touch events like Flick in WPF4?

I am creating an application with 7 touch windows and want to be able to handle touch gestures as simple events, in particular, clicks. I see how windows respond to requests, they turn out the icons when I click, but I can’t find an easy way to handle them. Something like grid.OnLeftFlick ...

Did I miss something stupid just? Is there any toolkit or something that I can use? Or do I need to write my own listener?

Thanks.

+4
source share
1 answer

While WPF4 supports multi-touch, it does not have built-in gesture support, at least not of the type you are thinking of. Functions such as flick, pinch-zoom, etc., Must be programmed on top of WPF4.

I don’t know of any higher level gesture support toolkits, but writing my own is not as difficult as it sounds. This WPF4 touch screen example shows, for example, touch movement, zooming, and rotation:

If you compile and run the sample, you will see that the handlers have only ten to twenty lines of code and use the powerful infrastructure in the touch API itself and the basic functions of WPF, such as transformation matrices. The Touch API supports inertia, etc., so try your hand to suit your needs.

In addition, of course, this example only works with Pen and Touch input devices, not with a normal mouse, but you indicated that you are developing a touch application.

+4
source

All Articles