is there a way to specify something like this in WPF:
CSS:
#someSpan input { color: #f1f1f1; }
or
span input { color: #f1f1f1; }
meaning, i’d like to have all TextBlock elements within container follow x style, w/out having to apply the style to each textblock.
just to clarify, i need to do something like this in WPF.
i know about the BasedOn attribute of a style.. but that’s not quite what i’m looking for here
looking for something like this
<Style x:Key="FileItem" TargetType="{x:Type #SomeContainer TextBlock}">
or maybe within SomeContainer, add a TextBlock style that will apply to all of its textblocks
Regarding the last part of your question, if you want to apply a style to all
TextBlocks within a particular element, just put theStylewithin that elements resources:If you have your styles stored in a separate
ResourceDictionarythen you can “import” them all for a particular element by merging resource dictionaries: