private void OnPropertyChanged(ManagedWeakReference?instance, DependencyProperty property, DependencyPropertyChangedEventArgs?args) { if (_svgElement == null) { return; } if (property == CenterProperty) { var center = Center; _svgElement.SetAttribute( ("cx", center.X.ToStringInvariant()), ("cy", center.Y.ToStringInvariant())); _svgElement.InvalidateMeasure(); } else if (property == RadiusXProperty) { _svgElement.SetAttribute("rx", RadiusX.ToStringInvariant()); _svgElement.InvalidateMeasure(); } else if (property == RadiusYProperty) { _svgElement.SetAttribute("ry", RadiusY.ToStringInvariant()); _svgElement.InvalidateMeasure(); } }
partial void OnRadiusYChangedPartial() { _rectangle.SetAttribute("ry", RadiusY.ToStringInvariant()); }