Jacob Carpenter’s Weblog

December 14, 2007

Dependency Property base value precedence

Filed under: WPF — Jacob @ 10:23 am

I often reference Adam Nathan‘s excellent Windows Presentation Foundation Unleashed. If you do any WPF development, you should definitely pick up a copy.

The following is from that book, and I’m posting it just to save me from having to find the table at the bottom of page 57 every time I need to know this:

Dependency property base values are determined using the following precedence:

  1. Local value
  2. Style triggers
  3. Template triggers
  4. Style setters
  5. Theme style triggers
  6. Theme style setters
  7. Property value inheritance
  8. Default value

That means when a style trigger doesn’t work, make sure you aren’t setting a local value. If you are, use a style setter instead.


Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

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

Create a free website or blog at WordPress.com.

%d bloggers like this: