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); } double left = currentPosition.X - this._initialMousePosition.X + this._initialMouseOffset.X; Debug.WriteLine("Adorner Left: " + left); double top = currentPosition.Y - this._initialMousePosition.Y + this._initialMouseOffset.Y; Debug.WriteLine("Adorner Top: " + top); this._draggedAdorner.SetPosition(left, top); }