Ejemplo n.º 1
0
 public static Visual GetAdornedElement(Visual adorner)
 {
     return adorner.GetValue(AdornedElementProperty);
 }
Ejemplo n.º 2
0
        private void UpdateAdornedElement(Visual adorner, Visual adorned)
        {
            var info = adorner.GetValue(s_adornedElementInfoProperty);

            if (info != null)
            {
                info.Subscription.Dispose();

                if (adorned == null)
                {
                    adorner.ClearValue(s_adornedElementInfoProperty);
                }
            }

            if (adorned != null)
            {
                if (info == null)
                {
                    info = new AdornedElementInfo();
                    adorner.SetValue(s_adornedElementInfoProperty, info);
                }

                info.Subscription = _tracker.Track(adorned).Subscribe(x =>
                {
                    info.Bounds = x;
                    InvalidateArrange();
                });
            }
        }
Ejemplo n.º 3
0
 /// <summary>
 /// Gets the transformed bounds of the visual.
 /// </summary>
 /// <param name="visual">The visual.</param>
 /// <returns>The transformed bounds.</returns>
 public static TransformedBounds GetTransformedBounds(Visual visual) => visual.GetValue(TransformedBoundsProperty);