/// <summary> /// Removes <paramref name="adorner"/> from the <see cref="AdornerLayer"/>. /// </summary> /// <param name="adorner">The <see cref="Adorner"/>.</param> public static void Remove(Adorner adorner) { var adornerLayer = (AdornerLayer)adorner.GetValue(AdornerLayerProperty) ?? GetAdornerLayer(adorner.AdornedElement); adornerLayer?.Remove(adorner); adorner.ClearValue(AdornerLayerProperty); }
/// <summary> /// Removes <paramref name="adorner"/> from the <see cref="AdornerLayer"/>. /// </summary> /// <param name="adorner">The <see cref="Adorner"/>.</param> public static void Remove(Adorner adorner) { if (adorner is null) { throw new System.ArgumentNullException(nameof(adorner)); } var adornerLayer = (AdornerLayer)adorner.GetValue(AdornerLayerProperty) ?? GetAdornerLayer(adorner.AdornedElement); adornerLayer?.Remove(adorner); adorner.ClearValue(AdornerLayerProperty); }
private static AdornerData GetAdornerData(this Adorner adorner) { return(adorner.GetValue <AdornerData>(AdornerDataProperty)); }
public static int GetAdornerIndex(this Adorner adorner) { return((int)adorner.GetValue(AdornerIndexProperty)); }