How would you attach a propertychanged callback to a property that is inherited? Like such:
class A {
DependencyProperty prop;
}
class B : A {
//...
prop.AddListener(PropertyChangeCallback);
}
How would you attach a propertychanged callback to a property that is inherited? Like such:
class A {
DependencyProperty prop;
}
class B : A {
//...
prop.AddListener(PropertyChangeCallback);
}
(edited to remove recommendation to use DependencyPropertyDescriptor, which is not available in Silverlight)
@Jon
That was the first solution I found, unfortunately it looks like there is no DependencyPropertyDescriptor
in Silverlight.
Have you tried a two way data binding between the two dependency properties?
@MojoFilter,
Jon's last suggestion link will give you what you're looking for: it uses weak references to register listening to changes by wrapping properties in a new object. Scroll to the bottom of "PropertyDescriptor AddValueChanged Alternative". You'll have to change the Binding code around a bit since BindingOperations doesn't exist.