How to implement drag & drop for a WPF application? I could open 2 the same apps and drag an object from one to another. Here\'s what I want to drag:
example WPF Drag and Drop : using vb.net 2010
vb.net code :
Class mofakfree
Private Sub label1_MouseDown(ByVal sender as Object, ByVal e as System.Windows.Input.MouseButtonEventArgs)
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
Dim lbl As Label = CType(sender, Label)
DragDrop.DoDragDrop(lbl, lbl.Content, DragDropEffects.Copy)
End Sub
Private Sub label2_DragEnter(ByVal sender as Object, ByVal e as System.Windows.DragEventArgs)
'xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
If e.Data.GetDataPresent(DataFormats.Text) Then
e.Effects = DragDropEffects.Copy
Else
e.Effects = DragDropEffects.None
End If
End Sub
Private Sub label2_Drop(ByVal sender as Object, ByVal e as System.Windows.DragEventArgs)
'xxxxxxxxxxxxxxxxxx
CType(sender, Label).Content = e.Data.GetData(DataFormats.Text)
End Sub
End Class