ReorderableListBox re-revisited

Update:
This now actually reorders the list.  I’d originally intended the consumer to handle the reordering of the items but I’ve tried to get the control to reorder internally; to be honest it’s a bit of a hack as you never know what type of list is going to be bound to the listbox.  I’ve create an ArrayList called internalList and do the reordering in that, reassigning it to the ListBox’s ItemsSource at the end.

Known Issues:
If you click on an item and then click/drag the same item what you are dragging around is actually the item after the one you’d expect.  It’s fine if you click/drag a new selection though; I’ll try and work that one out tonight.

Jim posted a comment asking if I had the source code for my ReorderableListBox sample.  The answer was no, now it is yes.  I’ve rewritten it against the RTM release of WPF, it still uses bits from Marcelo’s DragDropAdorner so thanks again to him.

You can get it from here.

The usual caveats apply, if you use it or modify it please keep the copyright notice with it and stick my blog address somewhere in your app.  If it doesn’t work don’t come running to me because it only took a couple of 4 hours 🙂

Have fun!

Advertisements

4 Responses to “ReorderableListBox re-revisited”

  1. Anon Says:

    It doesn’t work…

  2. Gili Says:

    It doesn’t work indeed, the sample is not running and the code logic seems to be broken as well.

  3. Jeff Says:

    I can’t get it to work either

  4. Jeff Says:

    Ahh, looks like there was some hard coded paths in the code.

    D:\projects\Scratch\smiddlem\ReorderableListBox\ReorderableListBox\SampleSourceData.xml


Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: