In FileZilla, I can select a file on a remote site and drag it onto my desktop. After I 'drop' the file on my desktop, FileZilla starts streaming the file.
I want to achieve similar functionality using WPF - is this possible and how can it be done?
Below is a snippet which shows how to drag a local file to the desktop using it's file path. My scenario is different in that the file is not physically available when DragDrop.DoDragDrop is called.
//FileDetails holds information about where the file is downloaded from.
FileDetails fileDetails = (FileDetails)listView.ItemContainerGenerator.
ItemFromContainer(listViewItem);
DataObject dragData = new DataObject(DataFormats.FileDrop, fileDetails);
DragDrop.DoDragDrop(listViewItem, dragData, DragDropEffects.Copy);
//At this point control goes to the OS.
Ideally I'd like to detect the 'drop' event with information about where the drop occured. Another option might be to pass a StreamWriter in to DoDragDrop() and write the bytes into it as they are received.