I want to cancel the natural minimizing behavior and change a WPF form size instead.
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.
That's what I have:
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;
}
}
}
Thanks,
EP