I have made WPF project with window style of none (can resize) then I created custom taskbar on top with exit, maximize and minimize buttons. So exactly this.WindowState = WindowState.Normal;
looks like this:
when I press maximize button windows state changes to this.WindowState = WindowState.Maximized;
and it does change but hiding some pixels on top and sides (probably on bottom too), see image bellow:
I'cant find anything about it on google and stackoverflow. So here is code am using to change window state:
private void maximize_Click(object sender, RoutedEventArgs e)
{
if(this.WindowState == WindowState.Normal)
{
this.WindowState = WindowState.Maximized;
} else
{
this.WindowState = WindowState.Normal;
}
}
and to make it maximized without hiding windows bottom taskbar am using this:
public MainWindow()
{
InitializeComponent();
MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
}
I have found reason of this (but not fix yet):
<WindowChrome.WindowChrome>
<WindowChrome GlassFrameThickness="0" CornerRadius="0" CaptionHeight="0"
UseAeroCaptionButtons="False" ResizeBorderThickness="7" />
</WindowChrome.WindowChrome>
if there is already question about but I couldn't find it please let me know