Reputation: 159
I am trying to implement a drag and drop mechanism in a wp8.1 app. I was trying the ManipulationDelta event for that but, then stumbled upon the DragEnter and Drop event. I tried it with the following xaml code but the DragEnter event handler isn't being invoked. What is the correct way to do this? I couldn't find much information about it on the net.
<Rectangle Height="50" Width="50" Fill="#FF5D1111"
x:Name="rectangle"
AllowDrop="True"
DragEnter="rectangle_DragEnter"></Rectangle>
Upvotes: 0
Views: 444
Reputation: 1683
There's a bit more involved in hooking up drag and drop. The DragEnter event will not fire simply because another element is dragged over it using a transform.
A drag (and drop) operation is initiated by calling DragDrop.DoDragDrop(...), typically within a MouseMove event.
Drag and Drop takes a few steps to setup, and can seem quite daunting for something that should be so simple. There are some good tutorials out there. This post explains the process with the minimum fuss :)
UPDATE: This solution is for WPF/Desktop apps. Windows Phone doesn't implement DragDrop in this way.
Upvotes: 1