Silverlight 4’s New Drag-and-Drop Support

Another new feature of Silverlight 4 that will enable developers to build richer UIs is drag-and-drop file support. In Silverlight 3, you had to pop up an OpenFileDialog to allow the user to select files from the local file system and make them available to a Silverlight application. In Silverlight 4, OpenFileDialog still works, but there is an alternative: let the user drag files from the operating system shell and drop them into a Silverlight application. The app can then consume the files in much the same way that it consumes files offered through OpenFileDialog.

To demonstrate the mechanics of Silverlight drop targeting, I built a sample that lets you open image files using drag-and-drop. Here’s what the app looked like after I grabbed a bunch of JPEGs from My Pictures and dropped them into the running application:

DragDropDemo

from Jeff Prosise’s Blog    more here

Similar posts

No Comments »

No comments yet.

RSS feed for comments on this post. TrackBack URL

Leave a comment