I have a ListBox in single-selection-mode containing some items. I implemented that the user is able to reorder the items by drag&drop. Everything works fine but it looks really ugly because the listbox automatically selects an item if the mousebutton is down and the cursor is moving over a item.
To be specific: To disable flickering in some situations I only move items when the item is dragged more than half over another item. When I start dragging item1 over item2 to place it behind item2, I want item1 to be selected while dragging. What happens is that item2 gets selected as soon as the cursor moves over item2. How can I get rid of this behavior?
I already tried to set e.Handled = true in PreviewMouseMove while dragging items, but this won't help.
If you like to see the code, it's here: http://pastebin.com/GTj96qV9. It is a behavior which enables any listbox which has a IList as DataSource to reorder its content by dragging.