title: WPF not applying default styles defined in MergedDictionaries?
body: <p>In a WPF application I defined default control styles in separate resource dictionaries (e.g. "ButtonStyle.xaml"), and added them as merged dictionaries to a resource dictionary named "ResDictionary.xaml".</p>
  
  <p>If I refer this "ResDictionary.xaml" as merged dictionary in my App.xaml, the default styles are not applied. However, if I refer the "ButtonStyle.xaml", it works correctly.</p>
  
  <p>If I recompile the same code in .NET 3.5 or 3.0, it recognizes and applies the default styles referred in "App.xaml" through "ResDictionary.xaml", but not in .NET 4.0.</p>
  
  <p>At runtime if I check the Application.Current.Resources dictionary, the default styles are there, but they are not applied, only if I specify the Style property explicitly in the Button control.</p>
  
  <p>Are there any solutions to refer a resource dictionary (containig default styles) this way in .NET 4.0?</p>
  
  <hr>
  
  <p>App.xaml:</p>
  
  <pre><code>&lt;Application.Resources&gt;
    &lt;ResourceDictionary&gt;
      &lt;ResourceDictionary.MergedDictionaries&gt;
        &lt;ResourceDictionary Source="Styles/ResDictionary.xaml"/&gt;
      &lt;/ResourceDictionary.MergedDictionaries&gt;
    &lt;/ResourceDictionary&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  
  <p>ResDictionary.xaml:</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;ResourceDictionary.MergedDictionaries&gt;
          &lt;ResourceDictionary Source="Default/ButtonStyle.xaml"/&gt;
      &lt;/ResourceDictionary.MergedDictionaries&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>ButtonStyle.xaml:</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="Button"&gt;
          &lt;Setter Property="Background" Value="Yellow"/&gt;
      &lt;/Style&gt;
  &lt;/ResourceDictionary&gt;
  </code></pre>