O'Reilly logo

XAML Unleashed by Adam Nathan

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

Reordering Items

Seemingly by magic, ListView contains automatic support for drag-and-drop reordering of items. As you drag an item around, the other items even move around to get out of the way! This is pictured in Figure 10.7. Dragging starts instantly for mouse or pen, but for touch the drag must start perpendicular to the panning direction to avoid confusion with the typical panning gesture. This can work end-to-end without any of your own C# code, although ListView does have a DragItemStarting event in case you want to add custom behavior.

Image

FIGURE 10.7 Dragging the red square to a new spot in the ListView works automatically, but you must ...

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