Michael Wolf
{Binding ME}
Thursday November 19, 2009
Silverlight 4 Drag from desktop
One of the exciting announcements made at pdc 09 was that silverlight 4 will support drag and drop from the desktop to both the web and out of browser. Whats great too is how similar the process is to WPF, the object properties are exactly the same, the only difference is 1 line in the actual file opening. Thus by sharing a common code, you can leverage this functionality in a full desktop experience as well as a silverlight experience with the exact same code.
The key difference being that in WPF you get as the drop data the filenames as a string[] and then you need to open the file, where as in silverlight what you get is a FileInfo[] ready for you process. The code snippet below shows this in action, and 2 routes to process the drop, one using conditional compilation the other simply looking at the type of data being provided.
Whats exciting about this is how this really helps bridge the web and desktop divide in the browser. In the out of browser scenario it will give our experiences a more true desktop feel that you are currently able to provide in true desktop apps in wpf or adobe air. Looking forward to all the bluing the lines experiences we will be able to create using silverlight 4.






