private static void RemovePreviewAdorner() { if (_overlayElt != null) { AdornerLayer.GetAdornerLayer(CurrentDropTargetAdvisor.GetTopContainer()).Remove(_overlayElt); _overlayElt = null; } }
/* ____________________________________________________________________ * Utility functions * ____________________________________________________________________ */ private static void CreatePreviewAdorner(UIElement adornedElt, IDataObject data) { if (_overlayElt != null) { return; } AdornerLayer layer = AdornerLayer.GetAdornerLayer(CurrentDropTargetAdvisor.GetTopContainer()); UIElement feedbackUI = CurrentDropTargetAdvisor.GetVisualFeedback(data); _overlayElt = new DropPreviewAdorner(feedbackUI, adornedElt); PositionAdorner(); layer.Add(_overlayElt); }