#125 – Responding to Changes in Dependency Properties for WPF Objects
November 14, 2010 Leave a comment
If you author a class that implements a dependency property, you can respond to changes in the value of the property value using the PropertyChangedCallback. You can specify this callback when registering the dependency property.
For standard WPF objects or controls, however, you can’t subscribe to this same callback to be notified when a property value changes. It’s possible that a particular WPF class fires an event when a property value changes, but this isn’t always the case.
There are two main ways that code which uses WPF objects can react to dependency property value changes:
- Using data binding
- Using triggers