Advertisement
Guest User

Untitled

a guest
Oct 15th, 2022
51
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.71 KB | None | 0 0
  1. class MyPathClass
  2. {
  3.     public static readonly DependencyProperty MyShapeProperty = DependencyProperty.RegisterAttached("MyShape", typeof(Geometry), typeof(MyPathClass), new FrameworkPropertyMetadata(OnMyShapeChanged()));
  4.  
  5.    
  6.     private static void OnMyShapeChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
  7.     {
  8.         (MyPathClass)d.MyShape = e.NewValue;
  9.     }
  10.    
  11.    
  12.     public Geometry MyShape
  13.     {
  14.         get
  15.         {
  16.             return (Geometry)GetValue(MyShapeProperty);
  17.         }
  18.         set
  19.         {
  20.             //Вот сюда без OnMyShapeChanged отказывается заходить
  21.             SetValue(MyShapeProperty, Value);
  22.         }
  23.     }
  24.  
  25. }
  26.  
  27.  
  28.  
  29.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement