O'Reilly logo

Windows Presentation Foundation 4.5 Cookbook by Pavel Yosifovich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Implementing drag-and-drop

Drag-and-drop functionality is common in applications, where one object is held down and dragged to some other object with the mouse. This approach is not as common as it used to be, especially with a mouse, because it requires hand coordination skills. Recent tablet devices are touch enabled, where drag and drop makes a lot of sense. As a general rule, always provide an alternative to drag-and-drop. That said, this can be a handy feature for advanced users.

Getting ready

Make sure Visual Studio is up and running.

How to do it...

We'll create an application that allows dragging elements (circles and rectangles) from one part of the window to another container within the same window, showing the necessary steps to get drag-and-drop ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required