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.


Create a free website or blog at WordPress.com.