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()](); } }
/// <inheritdoc /> public bool Equals(Ellipse other) => Center.Equals(other.Center) && RadiusX.Equals(other.RadiusX) && RadiusY.Equals(other.RadiusY);
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); }