I am trying to figure out how to move the items in a pre-populated listbox up and down via mouse drags.
I have looked at the Control.DoDragDrop method from microsof
This has helped me greatly thank you. Especially the generics version.
I made the following amendments:
Because I don't set the DataContext of the ListBox (just the ItemsSource), I use
var items = this.ItemsSource as IList;
in the Move method.
And at the end of "Move" I added:
this.SelectedItem = source;
as I want the user to have the moved item as the current selection.