示例#1
0
        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();
            }
        }
示例#2
0
 partial void OnRadiusYChangedPartial()
 {
     _rectangle.SetAttribute("ry", RadiusY.ToStringInvariant());
 }