I’m playing around with this demo trying to learn the TreeViewItem class.
Is there any (simple) way to prevent dragging items to a different parent. So that when the user drags any item, that item will always end up with the same parent.
The end result is that the entire tree’s hierarchy is prevented from being changed by the user regardless of how they move items within any parent.
Each TreeViewItem inherits DragAndDropTarget, so you can override isInterestedInDragSource() and make it return only true for it’s own children.
After doing so, none will accept a drag from a different parent.