In WPF, you can use the WindowState property :
myWindow.WindowState = WindowState.Maximized;
Of course, you can request this property to get the current state of the window:
if (myWindow.WindowState == WindowState.Maximized) {
// Window is currently maximized.
}
source
share