Question

Many Windows Phone apps allows you to reorder items in their lists by dragging them. Here is an example from one of them, Nokia App Folder:

enter image description here

You can see a small drag icon next to every item one can use to reorder items.

I need to add this drag reorder functionality to some lists in my WP8 Silverlight apps. Can you suggest any idea of how it can be done for such standard list controls like ListBox or LongListSelector? A link to a good Internet article is also acceptable.

Was it helpful?

Solution

ReorderListBox

One of the first implementations I saw of this was on the MSDN blogs a couple of years ago by Jason Ginchereau...

WP7 ReorderListBox

Although it was originally for the WP7 Listbox, it should be possible to modify and use it for WP8's LongListSelector, which replaces the ListBox. As the article mentions, the source code is on CodePlex or available as pre-built NuGet package.


Drag Re-ordering

Colin Eberhardt also has a fantastic article on re-ordering items in a list...

A gesture-driven Windows Phone To-do application part two - drag re-ordering

This approach doesn't use a Listbox or LonglistSelector but it is another great reference.


Commercial option

If you have access to the Telerik Windows Phone controls, their RadDataBoundListBox has a built-in re-order feature although it's implementation is a little different to the two mentioned above.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top