Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF TouchUp not firing when parent manipulation is enabled

Tags:

wpf

touch

I have a Canvas, with one child control. The child controls receives all PreviewTouchDown and PreviewTouchUp events fine - but after enabling Manipulation (IsManipulationEnabled = true) on the Canvas, only the "down" events get fired on child object, but the TouchUp and PreviewTouchUp events doesn't fire at all..

Any ideas what's going on here?

like image 463
Jaska Avatar asked Mar 17 '13 09:03

Jaska


1 Answers

You need to set IsManipulationEnabled to true on the child element, too.


The relationship between touch and manipulation events is explained in Input Overview / Touch and Manipulation, section The Relationship Between Touch and Manipulation Events:

A UIElement can always receive touch events. When the IsManipulationEnabled property is set to true, a UIElement can receive both touch and manipulation events. If the TouchDown event is not handled (that is, the Handled property is false), the manipulation logic captures the touch to the element and generates the manipulation events. If the Handled property is set to true in the TouchDown event, the manipulation logic does not generate manipulation events. The following illustration shows the relationship between touch events and manipulation events.

Touch and manipulation events

Touch and manipulation events

like image 189
Clemens Avatar answered Sep 20 '22 11:09

Clemens