Gon*_*oFJ 7 wpf events touchscreen right-click
我开始用触摸屏进行一些测试,我发现如果UIControl将"IsManipulationEnabled"属性设置为true,则不会捕获按住手势(WIN7)触发的MouseRightClick事件.难道我做错了什么?
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());
}
Run Code Online (Sandbox Code Playgroud)
设置后,IsManipulationEnabled = true;所有触摸事件都由 WC_Rectangle 捕获并处理,并将它们转换为操作事件。因此,触摸事件不会返回到引发它们的控件,这又意味着该控件无法将未处理的触摸事件提升为鼠标事件(默认)。看:
http://nui.joshland.org/2010/04/why-wont-wpf-controls-work-with-touch.html
| 归档时间: |
|
| 查看次数: |
2458 次 |
| 最近记录: |