private void DistroyAdorner() { if (Adorner != null) { Adorner.Remove(); Adorner = null; } }
private void CreateAdorner() { var supportsRemoveControl = this.AssociatedObject.DataContext as ViewModels.ISupportRemoveControl; if (supportsRemoveControl != null && !supportsRemoveControl.CanRemove) { return; } Adorner = new RemoveCollectionItemAdorner(this.AssociatedObject); Adorner.HorizontalAlignment = this.HorizontalAlignment; Adorner.VerticalAlignment = this.VerticalAlignment; Adorner.Content = CreateRemoveButton(); }