class MyLine : Shape { public static readonly DependencyProperty X11Property; public static readonly DependencyProperty X22Property; public static readonly DependencyProperty Y11Property; public static readonly DependencyProperty Y22Property; static MyLine() { X11Property = DependencyProperty.Register("X11", typeof(double), typeof(MyLine), new UIPropertyMetadata(double.NaN)); X22Property = DependencyProperty.Register("X22", typeof(double), typeof(MyLine), new UIPropertyMetadata(double.NaN)); Y11Property = DependencyProperty.Register("Y11", typeof(double), typeof(MyLine), new UIPropertyMetadata(double.NaN)); Y22Property = DependencyProperty.Register("Y22", typeof(double), typeof(MyLine), new UIPropertyMetadata(double.NaN)); } [TypeConverter(typeof(LengthConverter))] public double X11 { get { return (double)GetValue(X11Property); } set { SetValue(X11Property, value); } } [TypeConverter(typeof(LengthConverter))] public double X22 { get { return (double)GetValue(X22Property); } set { SetValue(X22Property, value); } } [TypeConverter(typeof(LengthConverter))] public double Y11 { get { return (double)GetValue(Y11Property); } set { SetValue(Y11Property, value); } } [TypeConverter(typeof(LengthConverter))] public double Y22 { get { return (double)GetValue(Y22Property); } set { SetValue(Y22Property, value); } } protected override System.Windows.Media.Geometry DefiningGeometry { get { var geometryGroup = new GeometryGroup();
Why, when I update myLine coordinates in the WPF designer (VS 2010), does it not update it automatically (live)?
When using the default WPF Line objects, they are automatically updated when the XAML code changes (is edited) in the XAML / Design view.
source share