title: WPF override style in merged dictionary
body: <p>In my dictionary file I have</p>
  
  <pre><code>&lt;Style TargetType="{x:Type Label}" BasedOn="{StaticResource {x:Type Label}}"&gt;
      &lt;Setter Property="Foreground" Value="White" /&gt;
      &lt;Setter Property="Background" Value="Black" /&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>In my Window xaml file I have</p>
  
  <pre><code>    &lt;Window.Resources&gt;
          &lt;ResourceDictionary&gt;
              &lt;ResourceDictionary.MergedDictionaries&gt;
                  &lt;ResourceDictionary Source="pack://application:,,,/XXX;component/XXX.xaml"/&gt;
              &lt;/ResourceDictionary.MergedDictionaries&gt;
  
              &lt;Style TargetType="Label" BasedOn="{StaticResource {x:Type Label}}"&gt;
                  &lt;Setter Property="FontSize" Value="20"/&gt;
                  &lt;Setter Property="VerticalAlignment" Value="Center"/&gt;
              &lt;/Style&gt;
          &lt;/ResourceDictionary&gt;
      &lt;/Window.Resources&gt;
  </code></pre>
  
  <p>In the designer I can see the label has black background and white foreground but during run time it has the default black foreground and transparent background. It is pretty obvious that I want to inherit the dictionary style and it is not working. Any thing I did wrong in there? I am Using VS 2013 and .NET 4.5</p>
  
  <p>Edit:
  If I remove the style inside Windows.Resources then the dictionary style will get applied. If I move the style from Windows Resource to the StackPanel.Resource which contains some labels, then the inheritance works fine</p>