private static void RemovePreviewAdorner() { if (s_OverlayElement != null) { AdornerLayer.GetAdornerLayer(GetTopContainer()).Remove(s_OverlayElement); s_OverlayElement = null; } }
private static void CreatePreviewAdorner(UIElement adornedElement, UIElement feedbackUI) { // Clear if there is an existing preview adorner RemovePreviewAdorner(); AdornerLayer layer = AdornerLayer.GetAdornerLayer(GetTopContainer()); s_OverlayElement = new DropPreviewAdorner(feedbackUI, adornedElement); layer.Add(s_OverlayElement); }