title: Setting Window background color using resource
body: <p>I need to use a resource to set the color of the main window in my WPF application. Since the resource declaration comes after the window declaration (I am importing a resource dictionary), I can't use a <code>Background</code> property in the <code>Window</code> object. So, I thought I would set the background this way:</p>
  
  <pre><code>&lt;Window.Resources&gt;
  ...
  &lt;/Window.Resources&gt;
  
  &lt;Window.Background&gt;
      &lt;SolidColorBrush Color="{StaticResource WindowBackgroundBrush}"  /&gt;
  &lt;/Window.Background&gt;
  </code></pre>
  
  <p>My syntax is a bit off, since the  object won't take a brush resource for its Color property. What's the fix? Thanks for your help.</p>