WPF: how can I find the source of the inherited property value

I'm working on a WPF project that has a specific nickname that I don't seem to understand: there are several controls that include other controls and are styled using a style definition in the resource dictionary. One of the internal controls is a shortcut. This tag has an inherited pad of 5.

The label has no style, not to mention any addition. And it is indicated as inherited, but I cannot find where it comes from. So my question is: how can I determine where this value is inherited from?

+1
source share
1 answer

As Michelle M said, DependencyPropertyHelper.GetValueSource is the way to go.

There is a clear assessment procedure in which the meaning may arise:

Most important thing on top

  • Force value on property system (CoerceValueCallback)
  • Animation
  • Locally set value
  • Style trigger
  • Template Trigger
  • Style setting
  • Theme style trigger
  • Theme Style Setting
  • Inheritance
  • Default value

Finally, ValidateValueCallback accepts or cancels the value if set

It probably helps

+1
source

Source: https://habr.com/ru/post/983555/


All Articles