title: Referencing a resource in a ResourceDictionary from a different ResourceDictionary in Silverlight
body: <p>I have the following set of code in my App.xaml:</p>
  
  <pre><code>&lt;Application.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceDictionary Source="/Client.Common;component/Theme/Brushes.xaml"/&gt;
              &lt;ResourceDictionary Source="/Client.Common;component/Theme/Fonts.xaml"/&gt;
              &lt;ResourceDictionary Source="/Client.Common;component/Theme/CoreStyles.xaml"/&gt;
              &lt;ResourceDictionary Source="/Client.Common;component/Theme/SdkStyles.xaml"/&gt;
              &lt;ResourceDictionary Source="/Client.Common;component/Theme/MyAppName.xaml"/&gt;
  
              &lt;ResourceDictionary Source="/Client.Common;component/Controls/NavigationPanel.xaml"/&gt;
           &lt;/ResourceDictionary.MergedDictionaries&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/Application.Resources&gt;
  </code></pre>
  
  <p>The <strong>NavigationPanel.xaml</strong> contains a style that looks like this:</p>
  
  <pre><code>&lt;Style x:Key="NavigationPanelListBox" TargetType="ListBox"&gt;
      &lt;Setter Property="Background" Value="{StaticResource DarkBackground}" /&gt;
      &lt;Lots of XAML&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>The <strong>{StaticResource DarkBackground}</strong> is defined in the <strong>Brushes.xaml</strong> file (i.e. the first resource dictionary).  It is defined as </p>
  
  <pre><code>&lt;SolidColorBrush x:Key="DarkBackground" Color="#FF707176" /&gt;
  </code></pre>
  
  <p>in the resource dictionary.  </p>
  
  <p>At runtime, I get the following error:</p>
  
  <pre><code>Cannot find a Resource with the Name/Key DarkBackground [Line: 16 Position: 44]
  </code></pre>
  
  <p>The line numbers and position references the <strong>NavigationPanel.xaml</strong> resource dictionary in the app.xaml.</p>
  
  <p>I can reference the brush from other controls, just not the included resource dictionary.</p>
  
  <p>Why can I not reference or why does it not resolve the reference to a resource that is higher in the heirarchy of the merged resource dictionary??  What am I missing here?</p>