我有一个 WPF 4 应用程序,我使用标准实现了拖放DragDrop.DoDragDrop
方法,但我使用触摸而不是鼠标事件来做到这一点。
我的网格(我正在拖动)的 XAML 如下:
<Grid x:Name="LayoutRoot"
ManipulationStarting="ManipulationStarting"
ManipulationDelta="ManipulationDelta"
ManipulationCompleted="ManipulationCompleted"
IsManipulationEnabled="True">
<!-- children in here -->
</Grid>
现在后面的代码是这样的:
private void ManipulationStarting(object sender, ManipulationStartingEventArgs e)
{
e.ManipulationContainer = this;
e.Handled = true;
}
private void ManipulationDelta(object sender, ManipulationDeltaEventArgs e)
{
e.Handled = true;
DragDrop.DoDragDrop(this, new DataObject(GetType(), this), DragDropEffects.Move);
}
private void ManipulationCompleted(object sender, ManipulationCompletedEventArgs e)
{
//completed stuff
}
BUT当我尝试用一根手指拖动,同时已经用另一根手指拖动时(例如,不同的手,这将模拟两个人),第二次触摸似乎没有正确注册,事实上,Windows 似乎认为我的两根手指正在尝试缩放(如捏合手势)...
有谁知道解决这个问题的方法吗?
多谢
标记
对于多点触控,您需要使用 Surface Toolkit for Windows Touch。它包括适合多点触控场景的拖放框架。它包括一个拖放框架 http://msdn.microsoft.com/en-us/library/ee957382.aspx。该链接包含几个操作场景。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)