Implement the applicable interfaces on your item-level view-models or, if you don't use the MVVM pattern, whatever is in theItemsSource collections
IMoveable<T> is for items that can be moved (dragged) from one location to another. You can add logic to theCanMove methods that disallows otherwise valid move operations per your requirements.
ITreeNode<T> is for items appearing in a TreeView, to indicate theSubItems and Parent properties.
Demonstration Application
Download the demo to see what sets the Qnomad Drag-and-Drop Manager for WPF apart. The demo consists of a TreeView that holds categories, and a ListView populated with the selected category's items. These two controls together have a total of three types of drag-drop operations setup on them.
Move a category within the TreeView
Move an item within the ListView
Link an item with another category
Manager Features
The Qnomad Drag-and-Drop Manager for WPF is a flexible and powerful solution for drag-and-drop within and between TreeViews and ListViews, and includes these features:
Supports drag-drop operations among any number of TreeViews and/or ListViews.
Shows drag adorner while dragging.
Explicitly supports two drop types: Move for moving an item, andLink for linking one (see demo).
User controls where, relative to the item under the drag cursor, the item will be dropped: above, below, or (for TreeViews) within.
Ability to receive drops from external sources, e.g. files from Windows Explorer, in the same manner as internal ones.
Spiffy animations for grabs, drops, and cancelled operations.
Auto-expand item if hovering over it during drag operation.
Auto-scroll TreeView or ListView if near top or bottom edge.
Works on the standard TreeView and ListView controls. No third-party TreeView or ListView control is required.
The Model-View-ViewModel design pattern is fully supported. Any implementation of MVVM can be used, although the pattern isn't necessary in order to use the Drag-and-Drop Manager.
Click the "Download" button at the top of this page to get the demo.