/// <summary> /// Removes the preview adorner. /// </summary> private static void RemovePreviewAdorner() { if (overlayElt != null) { AdornerLayer.GetAdornerLayer(CurrentDropTargetAdvisor.GetTopContainer()).Remove(overlayElt); overlayElt = null; } }
/* ------------------------------------------------------------------- * Utility functions * ------------------------------------------------------------------- */ #region PreviewAdorner /// <summary> /// Creates the preview adorner. /// </summary> /// <param name="adornedElt">The adorned element.</param> /// <param name="data">The objects data.</param> private static void CreatePreviewAdorner(UIElement adornedElt, IDataObject data) { if (overlayElt != null) { return; } var layer = AdornerLayer.GetAdornerLayer(CurrentDropTargetAdvisor.GetTopContainer()); var feedbackUI = CurrentDropTargetAdvisor.GetVisualFeedback(data); overlayElt = new DropPreviewAdorner(feedbackUI, adornedElt); PositionAdorner(); layer.Add(overlayElt); }