Reputation: 85
I'm starting to make some tests with a touch screen and I've found that if a UIControl has the "IsManipulationEnabled" attribute set to true then the MouseRightClick Events fired by the press and hold gesture (WIN7) is not captured. Am I doing something wrong?
public MainWindow()
{
InitializeComponent();
WC_Rectangle.IsManipulationEnabled = true;
WC_Rectangle.MouseRightButtonUp += new MouseButtonEventHandler(WC_Rectangle_MouseRightButtonUp);
}
void WC_Rectangle_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
{
System.Diagnostics.Debug.WriteLine("RIGHT CLICK : " + sender.ToString());
}
Upvotes: 7
Views: 2816
Reputation: 61
If you cancel the manipulation events you should get the mouse events.
Upvotes: 2
Reputation: 30813
After setting IsManipulationEnabled = true;
all touchevents are captured and handled by the WC_Rectangle which does transform them to Manipulation events. So the touchevents do not tunnel back to the control that raised them which in turn means the control can't promote unhandled touch events to mouse events (the default). see:
http://nui.joshland.org/2010/04/why-wont-wpf-controls-work-with-touch.html
Upvotes: 3