title: fully maximize wpf window using windowstate
body: <p>I am using the following code to change the size of the screen:</p>
  
  <pre><code>    private void MouseDoubleClick(object sender, MouseButtonEventArgs e)
      {
          if (e.ChangedButton == MouseButton.Left)
          {
              switch (WindowState)
              {
                  case (WindowState.Maximized):
                      {
                          WindowState = WindowState.Normal;
                          break;
                      }
                  case (WindowState.Normal):
                      {
                          WindowState = WindowState.Maximized;
                          break;
                      }
              }
          }
      }
  </code></pre>
  
  <p>However, when i double click as soon as the program starts, i get a small gap along the bottom of the form. To add to the confusion, when i re-size the form to any size (using drag-move), the problem is fixed. Could someone explain why this is occurring, and a possible fix to the problem?</p>