Since I didn’t register the property how would I add a property changed callback?
This works:
public static readonly DependencyProperty NameProperty =
FrameworkElement.NameProperty.AddOwner(typeof(Node), new FrameworkPropertyMetadata("Node", new PropertyChangedCallback(NamePropertyChanged)));`
but there is a warning which I don’t understand, so maybe there is another way of doing this:
WpfApplication1.Node.NameProperty’ hides inherited member ‘System.Windows.FrameworkElement.NameProperty’. Use the new keyword if hiding was intended.
Your class Node seems to be derived from FrameworkElement (or a subclass of FrameworkElement). Both Node and FrameworkElement define
which generates the compiler warning. Just write
in class Node.
You could also write
in Node’s static constructor.