title: Using style defined in merged dictionary from another merged dictionary
body: <p>Below you can see how I am trying to segregate styles by merging dictionaries (I'm skipping namespaces for the sake of cleanliness)</p>
  
  <p><em>App.xaml</em>:</p>
  
  <pre><code>&lt;Application.Resources&gt;       
      &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceDictionary Source="Style/Colors.xaml" /&gt;
              &lt;ResourceDictionary Source="Style/HeaderStyle.xaml"/&gt;
          &lt;/ResourceDictionary.MergedDictionaries&gt;            
      &lt;/ResourceDictionary&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  
  <p><em>Colors.xaml</em>:</p>
  
  <pre><code>&lt;SolidColorBrush x:Key="DarkTextForeground" Color="#7471b9"/&gt;
  </code></pre>
  
  <p><em>HeaderStyle.xaml</em>:</p>
  
  <pre><code>&lt;Style x:Key="HeaderTextBlockStyle" TargetType="TextBlock"&gt;
      &lt;Setter Property="Foreground" Value="{StaticResource DarkTextForeground}"/&gt;
      &lt;Setter Property="FontWeight" Value="Black"/&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>During compilation I get a following error:</p>
  
  <blockquote>
    <p>Cannot find a Resource with the Name/Key DarkTextForeground</p>
  </blockquote>
  
  <p>To make It work we have to merge <em>Colors.xaml</em> inside <em>HeaderStyle.xaml</em> like this:</p>
  
  <pre><code>&lt;ResourceDictionary.MergedDictionaries&gt;
      &lt;ResourceDictionary Source="Colors.xaml"/&gt;
  &lt;/ResourceDictionary.MergedDictionaries&gt;
  
  &lt;Style x:Key="HeaderTextBlockStyle" TargetType="TextBlock"&gt;
      &lt;Setter Property="Foreground" Value="{StaticResource DarkTextForeground}"/&gt;
      &lt;Setter Property="FontWeight" Value="Black"/&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>Can anyone explain to me, why I have to reference <em>Colors.xaml</em> in <em>HeaderStyle.xaml</em>?<BR> Can't I just reference styles defined in different merged dictionary?<BR>I assume that <em>Colors.xaml</em> is loaded before <em>HeaderStyle.xaml</em> so it should be visible for dictionaries defined later.</p>