WPF 4多点触控拖放

Mar*_*ark 5 wpf drag-and-drop .net-4.0 multi-touch

我有一个WPF 4应用程序,我使用标准DragDrop.DoDragDrop方法实现拖放,但我使用触摸而不是鼠标事件.

我的网格的XAML(我拖动)如下:

<Grid x:Name="LayoutRoot" 
      ManipulationStarting="ManipulationStarting" 
      ManipulationDelta="ManipulationDelta" 
      ManipulationCompleted="ManipulationCompleted"
      IsManipulationEnabled="True">
    <!-- children in here -->
</Grid>
Run Code Online (Sandbox Code Playgroud)

现在背后的代码是这样的:

    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
    }
Run Code Online (Sandbox Code Playgroud)

但是当我尝试用一​​根手指拖动同时已经用另一根手指拖动(例如,不同的手,这将模拟两个人)时,第二次触摸似乎没有正确注册,事实上,似乎窗户认为我的两根手指是试图扩展(像捏手势)......

有没有人知道解决这个问题的方法?

非常感谢马克

Jos*_*ake 4

对于多点触控,您需要使用 Surface Toolkit for Windows Touch。它包括适合多点触控场景的拖放框架。它包括一个拖放框架。该链接包含几个操作场景。