I have a WPF style that sets TextDecorations dependency property for TargetType: TexBlock. I need to use the same style for certain Run elements which are in some TextBlock which doesn’t itself use the aforementioned style. How can I achieve this without repeating the same style with just a different TargetType?
I have a WPF style that sets TextDecorations dependency property for TargetType: TexBlock .
Share
Just do not specify a
TargetTypebut qualify the property, e.g.:If you want to further develop the style you can use
BasedOn, this also allows implicit application of said style by not setting a key on the derived style.