Reputation: 193
There are several events which deal with manipulation (and thus drag&drop):
In the ManipulationStarting event, the event args (type ManipulationStartingRoutedEventArgs) allow me to set the Mode attribute to ManipulationModes.None -- is it correct that this means that no manipulation is allowed and thus no drag&drop?
I'm asking because I've come across a strange behaviour when I was playing with the official XAML user input events sample application, especially with scenario 4 (drag&drop).
Just set the Mode to ManipulationModes.None in the ManipulationStarting event of Scenario4.xaml.cs:
void ManipulateMe_ManipulationStarting(object sender, ManipulationStartingRoutedEventArgs e)
{
forceManipulationsToEnd = false;
e.Mode = ManipulationModes.None; // <-- this is new
e.Handled = true;
}
Nevertheless, with every third drag attempt I can drag the rectangle around. I've recorded a video to demonstrate this: http://www.youtube.com/watch?v=psytuTailHg.
This problem does not only occur with this sample but also in my own application.
Upvotes: 0
Views: 634
Reputation: 6021
On a gridview for example you can implement the DragItemStarting event, and set e.Cancel = true;
to prevent this behaviour - does that not meet your needs?
Upvotes: 1