private void RemoveDraggedAdorner() { if (_draggedAdorner == null) { return; } _draggedAdorner.Detach(); _draggedAdorner = null; }
// Creates or updates the dragged Adorner. private void ShowDraggedAdorner(Point currentPosition) { if (_draggedAdorner == null) { var adornerLayer = AdornerLayer.GetAdornerLayer(_sourceItemsControl); _draggedAdorner = new DraggedAdorner(_draggedData, GetDragDropTemplate(_sourceItemsControl), _sourceItemContainer, adornerLayer); } var left = currentPosition.X - _initialMousePosition.X + _initialMouseOffset.X; Debug.WriteLine("Adorner Left: " + left); var top = currentPosition.Y - _initialMousePosition.Y + _initialMouseOffset.Y; Debug.WriteLine("Adorner Top: " + top); _draggedAdorner.SetPosition(left, top); }