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();
            }
        }
Exemple #2
0
 partial void OnRadiusXChangedPartial()
 {
     _rectangle.SetAttribute("rx", RadiusX.ToStringInvariant());
 }