title: Specifying a custom Window's default appearance in WPF?
body: <p>I would like to make a library of some of my commonly used WPF controls, and one of these controls is a <code>CustomWindow</code> which inherits from the <code>Window</code> class. How can I get my <code>CustomWindow</code> to use a default appearance that is defined in the library with it?</p>
  
  <p>I can replace</p>
  
  <pre><code>&lt;Window x:Class="..." /&gt;
  </code></pre>
  
  <p>with </p>
  
  <pre><code>&lt;MyControls:CustomWindow x:Class="..." /&gt;
  </code></pre>
  
  <p>and it works for the window behavior, but not the appearnce.</p>
  
  <p><strong>EDIT</strong></p>
  
  <p>Here is a simplified version of what I have so far:</p>
  
  <p>Custom Window Control. Located in the Control library.</p>
  
  <pre><code>public class CustomChromeWindow: Window
  {
      static CustomChromeWindow()
      {
          DefaultStyleKeyProperty.OverrideMetadata(typeof(CustomChromeWindow), 
              new FrameworkPropertyMetadata(typeof(CustomChromeWindow)));
      } 
  }
  </code></pre>
  
  <p>Window Style. Located in a Generic.xaml, a ResourceDictionary in the Themes folder of the control library</p>
  
  <pre><code>&lt;Style TargetType="local:CustomChromeWindow"&gt;
      &lt;Setter Property="WindowStyle" Value="None" /&gt;
      &lt;Setter Property="Background" Value="Red" /&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>Test Window. Startup window of a separate project that references the control library</p>
  
  <pre><code>&lt;local:CustomChromeWindow
      x:Class="MyControlsTest.MainWindow"
      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
      xmlns:local="clr-namespace:MyControls;assembly=MyControls"
      Title="MainWindow" Height="350" Width="525"
      &gt;
      &lt;Grid&gt;
          &lt;TextBlock Text="This is a Test" /&gt;
      &lt;/Grid&gt;
  &lt;/local:CustomChromeWindow&gt;
  </code></pre>
  
  <p>What I end up getting is a window with the regular WindowStyle and a black background.</p>