Example #1
0
 /// <summary>
 /// Removes the dragged Adorner
 /// </summary>
 private void RemoveDraggedAdorner()
 {
     if (this.draggedAdorner != null)
     {
         this.draggedAdorner.Detach();
         this.draggedAdorner = null;
     }
 }
Example #2
0
 /// <summary>
 /// Creates or updates the dragged Adorner
 /// </summary>
 /// <param name="currentPosition">Current position of the dragged Adorner</param>
 private void ShowDraggedAdorner(Point currentPosition)
 {
     if (this.draggedAdorner == null)
     {
         if (this.sourceItemsControl != null)
         {
             var adornerLayer = AdornerLayer.GetAdornerLayer(this.sourceItemsControl);
             this.draggedAdorner = new DraggedAdorner(this.draggedData, GetDragDropTemplate(this.sourceItemsControl), this.sourceItemsControl, adornerLayer);
         }
         else
         {
             var adornerLayer = AdornerLayer.GetAdornerLayer(this.sourceItemContainer);
             this.draggedAdorner = new DraggedAdorner(this.draggedData, GetDragDropTemplate(this.sourceItemContainer), this.sourceItemContainer, adornerLayer);
         }
     }
     this.draggedAdorner.SetPosition(currentPosition.X - this.initialMousePosition.X + this.initialMouseOffset.X, currentPosition.Y - this.initialMousePosition.Y + this.initialMouseOffset.Y);
 }