title: Problem with custom window class accessing resources in another assembly
body: <p>My first foray into WPF has been creating an applcation (ABC) and a solution of class libraries (XYZ) that will be used on all future applications.</p>
  
  <p>In order to reuse the window from ABC so all applications have a consistent look and feel, I've created a base class that inherits from <code>System.Windows.Window</code>. This class resides in the XYZWindows class library project in namespace XYZ.Windows. I also have a class library project called XYZResources that contains (at present) two themed skins comprised of dozens of styles.</p>
  
  <p>In application ABC I was able to reference these skins via code in App.xaml:</p>
  
  <pre class="lang-cs prettyprint-override"><code>public void ApplySkin( ThemedSkin Skin ) {
      Collection&lt;ResourceDictionary&gt; merged = base.Resources.MergedDictionaries;
  
      switch( Skin ) {
          case ThemedSkin.Dark:
              merged[0].Source = new Uri( "pack://application:,,,/XYZResources;component/Themes/Dark.xaml", UriKind.Absolute );
          case ThemedSkin.Light:
              merged[0].Source = new Uri( "pack://application:,,,/XYZResources;component/Themes/Light.xaml", UriKind.Absolute );
      }
  }
  </code></pre>
  
  <p>Being new to WPF, I'm not sure where I found this but it worked and I was able to globally style all controls as well as reference individual styles in XAML using <code>{Dynamic Resource}</code>. Because my window class is my first attempt at creating a window strictly in code, I'm not sure how to access my styles.</p>
  
  <p>I've tinkered with ComponentResourceKey, but I haven't figured out what type I need to use in its constructor.</p>
  
  <p>I need a really good tutorial or at least a push in the right direction, but this kind of stuff is really difficult to Google successfully.</p>