I’ve got a TreeView in my WPF application, with a canvas right next to it.
I would like to implement functionality whereby the user is able to drag a TreeViewItem, and drop it in the canvas (where a method will be called and some action will be carried out in the canvas).
WinForms seems to have events for doing this, but I can’t find similar functionality in WPF.
Any suggestions?
There’s quite a lot on msdn about implementing WPF drag and drop, I’d recommend checking out the tutorial there. You’ll need to start by setting the AllowDrop property on the canvas to true. Hopefully following the tutorial will clear it up for you, or at least generate some more specific questions.