title: How do I set the size of a WPF window based on a desired client area size?
body: <p>I know that in XAML/WPF, I can set the Window size using the Width and Height properties, but suppose I want to set the window size such that the client area (minus the Windows borders/decorations) will be a certain fixed size, what is the easiest way to do that?</p>
  
  <p>Like, suppose I want the client area of the window to be 640x480, ala this:</p>
  
  <pre><code>    &lt;Window x:Class="SomeProject.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="Window1" Background="Black"&gt;
  
  &lt;Canvas Width="640" Height="480"/&gt;
  &lt;/Window&gt;
  </code></pre>
  
  <p>How can I ensure the inital Window size is such that it has a 640x480 client size that fits the child canvas perfectly?  I'm only really interested in how to easily set this up for startup time, not so worried about how to deal with resize events and such.</p>
  
  <p>Thanks.</p>