Dragging and dropping from Silverlight to WPF
3 answers
Dragging and dropping into a Silverlight application from other surfaces outside of a Silverlight application is only available in Silverlight 4 and is limited by the file payload.
Hence, the only drag and drop functionality you can achieve between a WPF application and Silverlight is if you initiate a drag and drop operation in a WPF application and include a standard file list as part of the tab-bound data.
+1
a source to share
Anthony and Timores are correct in their answers, but I'll try to get creative with some ideas here:
- If you can use the same backend services, maybe when the drag starts (MouseDown + MouseMove) you can send a chunk of XAML up to the service to store / cache the content and when the drag ends up by another application (MouseEnter + MouseUp over the target). you can call this service to pull the cached content
- In Silverlight 4, you have access to your users' My folders on the local file system. You may be able to use the temp file and start / drag drag events described above to pass you a piece of XAML from one application to another. See http://timheuer.com/blog/archive/2009/11/18/whats-new-in-silverlight-4-complete-guide-new-features.aspx#localfiles
- If you want to drag and drop text, you can use the clipboard. So when dragging starts, copy the text to the clipboard. When you're done dragging in another app, read from the clipboard and add the content to the target folder
0
a source to share