WPF 4 multi-touch drag and drop

I have a WPF 4 application in which I implemented Drag and Drop using the standard DragDrop.DoDragDrop approach, but I do this using touch instead of Mouse events.

My XAML for my grid (this is Im drag and drop) looks like this:

 <Grid x:Name="LayoutRoot" ManipulationStarting="ManipulationStarting" ManipulationDelta="ManipulationDelta" ManipulationCompleted="ManipulationCompleted" IsManipulationEnabled="True"> <!-- children in here --> </Grid> 

Now the code looks like this:

  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 , when I try to drag with one finger while dragging with the other finger (for example, for hands, for example, to simulate two people), the second touch does not seem to register properly, it seems like windows think my two fingers are trying to scale ( e.g. pinch gesture) ...

Does anyone know a way around this?

Thanks a lot Mark

+5
source share
2 answers

For multi-touch, you'll want to use the Surface Toolkit for Windows Touch. It includes a drag and drop structure suitable for multi-touch scenarios. It includes drag and drop frames . This link includes several practical use cases.

+4
source

Although this is just an educated guess, I would say that DragDrop.DoDragDrop() not able to handle multiple drag and drop tasks in parallel.

Indices:

  • There is no way to pass the touch identifier to the method (which would be necessary to differentiate the current drag gestures)
  • The implementation of DoDragDrop() is static
  • The call to DoDragDrop() blocked until drops occur or are canceled.
  • It is based on the OLE drag and drop version (which has not been updated for Win7)

However, I would be glad if someone could correct me in this question, because currently I am also looking for a DND API suitable for supporting touches.

Regards, Seven

+1
source

All Articles