How to override a global style (that doesn't have an x:Key), or alternatively apply a named style to all type-targeted controls?

前端 未结 3 705
遇见更好的自我
遇见更好的自我 2021-01-31 07:45

I declared a style that I want to apply to ALL the buttons in the project, the style resides in the ResourceDictionary:



  

  

Now the two last styles are applied to all the IntegerUpDown and DoubleUpDown controls within your application without any mention of a key.

So the base rule: the base style must have the key to refer to it, and the derived styles may not and therefore they can be applied without any keys - only by target types.

提交回复
热议问题