title: Accessing ResourceDictionary from WPF UserControl
body: <p>I'm trying to access a resource dictionary in a UserControl code-behind via C# and I'm having little success.</p>
  
  <p>Merged Dictionary:</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;ResourceDictionary&gt;
          &lt;ResourceDictionary.MergedDictionaries&gt;
              &lt;ResourceDictionary Source="/Resources/BiometricDictionary.xaml" /&gt;                
          &lt;/ResourceDictionary.MergedDictionaries&gt;
      &lt;/ResourceDictionary&gt;
  &lt;/UserControl.Resources&gt;
  </code></pre>
  
  <p>Embedded Dictionary:</p>
  
  <pre><code>&lt;UserControl.Resources&gt;
      &lt;BitmapImage x:Key="imageDefault"&gt;/Resources/Images/default_thumb.png&lt;/BitmapImage&gt;
      &lt;BitmapImage x:Key="imageDisconnected"&gt;/Resources/Images/disconnect_thumb.png&lt;/BitmapImage&gt;
      &lt;BitmapImage x:Key="imageFailed"&gt;/Resources/Images/failed_thumb.png&lt;/BitmapImage&gt;
      &lt;BitmapImage x:Key="imageSuccess"&gt;/Resources/Images/success_thumb.png&lt;/BitmapImage&gt;
  &lt;/UserControl.Resources&gt;
  </code></pre>
  
  <p>Code behind:</p>
  
  <pre><code>        var resourceDictionary = new ResourceDictionary();
          resourceDictionary.Source = new Uri("/Resources/BiometricDictionary.xaml", UriKind.Relative);
  </code></pre>
  
  <p>I've tried all of the examples and helpful tips but coming up short.  Right now, success would be the ability to load the dictionary.  Any suggestions? </p>