tags:

views:

710

answers:

1

How to hook to the property value change notification for properties of a FrameworkElement? We are loading xaml at run time, and for each element in the visual tree, we need to hook up something to receive a property value change notification, when ever some one changes a property value of the element.

What is the best way, if one exists?

+2  A: 

If you want to be notified when the value of a dependency property changed, you can do that (case of the Tag property) :

DependencyPropertyDescriptor desc = DependencyPropertyDescriptor.FromProperty(FrameworkElement.TagProperty, typeof(FrameworkElement));
desc.AddValueChanged(someObject, someEventHandler);
Thomas Levesque