相关疑难解决方法(0)

WPF 4多点触控拖放

我有一个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)

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

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

非常感谢马克

wpf drag-and-drop .net-4.0 multi-touch

5
推荐指数
1
解决办法
3510
查看次数

标签 统计

.net-4.0 ×1

drag-and-drop ×1

multi-touch ×1

wpf ×1