title: How to cancel the WPF form minimize event
body: <p>I want to cancel the natural minimizing behavior and change a WPF form size instead.</p>
  
  <p>I have a solution with the Window_StateChanged but it doesn't look so nice - the window first minimized then jumps back and does the size alteration. Is there a way to accomplish this? I Googled for Window_StateChanging but couldn't figure it out, some sort of external lib that I prefer not to use.</p>
  
  <p>That's what I have:</p>
  
  <pre><code>private void Window_StateChanged(object sender, EventArgs e)
  {
      switch (this.WindowState)
      {
          case WindowState.Minimized:
              {
                  WindowState = System.Windows.WindowState.Normal;
                  this.Width = 500;
                  this.Height = 800;
                  break;
              }
      }
  }
  </code></pre>
  
  <p>Thanks,</p>
  
  <p>EP</p>