I would like to make my application such that it can maximize to full screen means it hide the windows task bar and the title bar as well. And it should triggered by a butto
Try this:
<Window ShowTitleBar="False" IgnoreTaskbarOnMaximize="True">
You need to set the ResizeMode to NoResize and WindowState to Maximized
<Window ...
ResizeMode="NoResize" WindowState="Maximized">
Simply hook this event handler to the Loaded event of the form, works fine.
Do not apply this stuff in the constructor of the form (which won't work for me).
private void aWindow_Loaded(object sender, RoutedEventArgs e)
{
MaxHeight = SystemParameters.FullPrimaryScreenHeight;
MaxWidth = SystemParameters.FullPrimaryScreenWidth;
Width = SystemParameters.FullPrimaryScreenWidth;
Height = SystemParameters.FullPrimaryScreenHeight;
WindowState = WindowState.Maximized;
ResizeMode = ResizeMode.NoResize;
Left = 0;
Top = 0;
Topmost = true;
ShowInTaskbar = false;
//throw new NotImplementedException();
}