title: Merging Resources Dictionaries
body: <p>i'm trying merging wpf resource dictionaries on the code behind but for some reasion this isn't working. If i try merge the dictionaries on the document itself it's running for instance:</p>
  
  <pre><code>&lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  xmlns:local="clr-namespace:WpfApplication212;assembly=WpfApplication212"&gt;
  
  &lt;ResourceDictionary.MergedDictionaries&gt;
      &lt;ResourceDictionary Source="Theme.xaml"&gt;&lt;/ResourceDictionary&gt;
  &lt;/ResourceDictionary.MergedDictionaries&gt;
  
  &lt;Style TargetType="{x:Type local:URComboBox}" BasedOn="{StaticResource ComboBoxStyle}"&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p></p>
  
  <p>This is working, but if i comment the ResourceDictionary.MergedDictionaries and in code try this:</p>
  
  <pre><code>ResourceDictionary skin = new ResourceDictionary();
  skin.Source = styleLocation;
  ResourceDictionary skinFather = new ResourceDictionary();
  skinFather.MergedDictionaries.Add(skin);
  skinFather.Source = styleLocationFather;
  </code></pre>
  
  <p>This will break because can't find the resource.</p>