Example #1
0
        private void UpdateRadius()
        {
            var child = Content as FrameworkElement;

            if (child == null || !RadiusX.Equals(0) || !RadiusY.Equals(0))
            {
                return;
            }

            var types = new Dictionary <Type, Action>
            {
                { typeof(Grid), () => RadiusX = RadiusY = ((Grid)child).CornerRadius.TopLeft },
                { typeof(Border), () => RadiusX = RadiusY = ((Border)child).CornerRadius.TopLeft },
                { typeof(RelativePanel), () => RadiusX = RadiusY = ((RelativePanel)child).CornerRadius.TopLeft },
                { typeof(StackPanel), () => RadiusX = RadiusY = ((StackPanel)child).CornerRadius.TopLeft }
            };

            if (types.ContainsKey(child.GetType()))
            {
                types[child.GetType()]();
            }
        }
Example #2
0
 /// <inheritdoc />
 public bool Equals(Ellipse other) => Center.Equals(other.Center) && RadiusX.Equals(other.RadiusX) && RadiusY.Equals(other.RadiusY);
Example #3
0
 public bool Equals(RadialGradient other)
 {
     if (ReferenceEquals(null, other))
     {
         return(false);
     }
     if (ReferenceEquals(this, other))
     {
         return(true);
     }
     return(Center.Equals(other.Center) && OriginOffset.Equals(other.OriginOffset) && RadiusX.Equals(other.RadiusX) && RadiusY.Equals(other.RadiusY) && GradientStops == other.GradientStops);
 }