Override typed textblock style for contentpresenter in WPF
问题 I have defined the Textblock style that are typed (as opposed to have a key value) so that it applies to all the textblocks. <Style TargetType="{x:Type TextBlock}"> <Setter Property="FontFamily" Value="MyFancyFont"/> <Setter Property="FontSize" Value="13.333" /> <Setter Property="Foreground" Value="Gray" /> </Style> Now I have a, say, TreeViewItem, which I'd like to show as blue background and as white foreground against dark background when it's selected. <!--part of the treeviewitem