#125 – Responding to Changes in Dependency Properties for WPF Objects

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
Advertisements

About Sean
Software developer in the Twin Cities area, passionate about software development and sailing.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: