private void RemoveDraggedAdorner() { if (this.draggedAdorner != null) { this.draggedAdorner.Detach(); this.draggedAdorner = null; } }
// Adorners // Creates or updates the dragged Adorner. private void ShowDraggedAdorner(Point currentPosition) { if (this.draggedAdorner == null) { var adornerLayer = AdornerLayer.GetAdornerLayer(this.sourceItemsControl); this.draggedAdorner = new DraggedAdorner(this.draggedData, GetDragDropTemplate(this.sourceItemsControl), this.sourceItemContainer, adornerLayer); } this.draggedAdorner.SetPosition(currentPosition.X - this.initialMousePosition.X + this.initialMouseOffset.X, currentPosition.Y - this.initialMousePosition.Y + this.initialMouseOffset.Y); }