void InitializeDragOperation(ListBoxItem itemToDrag)
        {
            // Set some flags used during the drag operation.
            this.IsDragInProgress = true;
            this.canInitiateDrag  = false;

            // Let the ListBoxItem know that it is being dragged.
            ListBoxItemDragState.SetIsBeingDragged(itemToDrag, true);
        }
        void FinishDragOperation(ListBoxItem draggedItem, AdornerLayer adornerLayer)
        {
            // Let the ListBoxItem know that it is not being dragged anymore.
            ListBoxItemDragState.SetIsBeingDragged(draggedItem, false);

            this.IsDragInProgress = false;

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

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