title: WPF Nested Styles
body: <p>I have TextBlocks and Comboboxes in my application i want the Textblock foreground to be white and the Combobox Foreground to be Black. </p>
  
  <p>What i tried was:</p>
  
  <pre><code>    &lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
  
  &lt;Style TargetType="{x:Type TextBlock}"&gt;
      &lt;Setter Property="Foreground" Value="White" /&gt;
  &lt;/Style&gt;
  &lt;Style TargetType="{x:Type ComboBox}"&gt;
      &lt;Setter Property="Foreground" Value="Red" /&gt;
  &lt;/Style&gt;
  &lt;/ResourceDictionary&gt;
  
  
  
  &lt;Grid Background="Black"&gt;
      &lt;TextBlock Height="23" HorizontalAlignment="Left" Margin="27,30,0,0" Name="textBlock1" Text="TextBlock" VerticalAlignment="Top" /&gt;
      &lt;ComboBox Height="23" HorizontalAlignment="Left" Margin="12,99,0,0" Name="comboBox1" VerticalAlignment="Top" Width="120" /&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>But the combobox Foreground is still white how to override the TextBlock Foreground in the combobox? (In CSS this is easy but no idea in WPF)</p>
  
  <p>If i remove the Style for TextBlock everything else changes just fine but when i put the style back every foreground is white.</p>