Esempio n. 1
0
        static void InitializeDragOperation(TreeViewItem itemToDrag)
        {
            // Set some flags used during the drag operation.
            IsDragInProgress = true;
            canInitiateDrag  = false;

            // Let the treeViewItem know that it is being dragged.
            TreeViewItemDragState.SetIsBeingDragged(SelectedTreeViewItem, true);
        }
Esempio n. 2
0
        static void FinishDragOperation(TreeViewItem draggedItem, AdornerLayer adornerLayer)
        {
            // Let the treeViewItem know that it is not being dragged anymore.
            TreeViewItemDragState.SetIsBeingDragged(SelectedTreeViewItem, false);

            IsDragInProgress = false;

            if (ItemUnderDragCursor != null)
            {
                ItemUnderDragCursor = null;
            }

            // Remove the drag adorner from the adorner layer.
            if (adornerLayer != null)
            {
                adornerLayer.Remove(dragAdorner);
                dragAdorner = null;
            }
        }