Hello,
I already implemented some drag and drop behaviors in my application. To do so, I create a DragVisual in the OnDragInitialize event (registered via DragDropManager.AddDragInitializeHandler), and I give it a DataContext (a Content actually) and a ContentTemplate. Then I can have a nice preview of the data being dragged that I can template as I wish and that will follow the mouse cursor.
This work perfectly when I'm dragging data from my app, to my app.
Now I am willing to be able to drag files, from the windows explorer, to a specific control of my application. I would like to create a DragVisual in the same way, when the mouse cursor enters one of the windows of my application (and destroy it if the mouse cursor leaves the window, but this is another problem).
The problem is that when the drag starts from another application, OnDragInitialize is not invoked (which makes perfectly sense). But how can I achieve to create a DragVisual in this context? None of the other drag'n'drop-related events have a DragVisual in their EventArgs.
Thanks
I already implemented some drag and drop behaviors in my application. To do so, I create a DragVisual in the OnDragInitialize event (registered via DragDropManager.AddDragInitializeHandler), and I give it a DataContext (a Content actually) and a ContentTemplate. Then I can have a nice preview of the data being dragged that I can template as I wish and that will follow the mouse cursor.
This work perfectly when I'm dragging data from my app, to my app.
Now I am willing to be able to drag files, from the windows explorer, to a specific control of my application. I would like to create a DragVisual in the same way, when the mouse cursor enters one of the windows of my application (and destroy it if the mouse cursor leaves the window, but this is another problem).
The problem is that when the drag starts from another application, OnDragInitialize is not invoked (which makes perfectly sense). But how can I achieve to create a DragVisual in this context? None of the other drag'n'drop-related events have a DragVisual in their EventArgs.
Thanks