I have a WFP application with a tree where I can drag and drop objects around.
DragDrop.DoDragDrop(dragSource, new DataObject(typeof(IFileObject), ((FilePresenter)dragSource.DataContext).FileObject), DragDropEffects.Move | DragDropEffects.Copy);
Each tree object also represents a file on my harddrive. I would like to be able to also drag that object from my WPF application to explorer (to create a copy) or maybe to Outlook to create an attachment.
I assume (probably wrongly) that it depends on the target what kind of DataObject I have to attach, but at the time of starting the drag I don't where the user will drop the DataObject.
I know that other applications can create different kind of drops. When I drag an e-mail in Outlook for example, i can move it to a different folder. Dragging it to the explorer will create a msg file. Dragging it to a text editor will insert the subject of the email as text.
How do I have to initialize the DragDrop.DoDragDrop(...)
to drag&drop inside my application by using my internal objects and outside my application to provide a filename?
This is not a duplicate of Can we drop a file in windows explorer from WPF window? My question is how to support BOTH internal and external drag and drop (if possible at all).