Maximizing a custom window to include taskbar
<p>I made a custom window for my app and I wrote some code if a user clicks my custom maximize button:</p>

<pre><code>    private void MaxThis(object sender, System.Windows.RoutedEventArgs e)
    { if (WindowState == WindowState.Maximized){
        WindowState = WindowState.Normal;}

    else { 
    this.Top = 0;
    this.Left = 0;
    this.MaxWidth = System.Windows.SystemParameters.WorkArea.Width; 
    this.MaxHeight = System.Windows.SystemParameters.WorkArea.Height;
    this.WindowState = WindowState.Maximized;
    }
    }
</code></pre>

<p>The restoring to the normal state works fine. However when I want to maximize, it maximizes the window with a small margin on the right and bottom of the screen. Clicking maximize again fixes this somehow. How do I fix this to maximize at the first click...?</p>
