In my application, I would like to allow user to drag item from a treeview to a canvas a generate a control for the dragged item. I have tried to use the PanelDragDropTarget to do that, but the canvas couldn't listen to the drop event.
In xaml file:
<toolkit:PanelDragDropTarget AllowDrop="True" Drop="drop_event">
<Canvas Name="myCanvas" />
</toolkit:PanelDragDropTarget>
In xaml.cs file:
void drop_event(object sender, DropEventArgs e)
{
MessageBox.Show("dropped");
}
What is the correct way to do that? Many thanks.