Borderless window application takes up more space than my screen resolution
I solved the problem this way:
XAML:
WindowStyle="None"
Left="0"
Top="0"
Width="{Binding WPFSettings.Width}"
Height="{Binding WPFSettings.Height}">
Visual Basic:
Public Class WPFSettings
Public ReadOnly Property Width() As Double
Get
Return System.Windows.SystemParameters.PrimaryScreenWidth
End Get
End Property
Public ReadOnly Property Height() As Double
Get
Return System.Windows.SystemParameters.PrimaryScreenHeight
End Get
End Property
End Class
It works pretty good.
Try this
Width="{Binding Source={x:Static SystemParameters.WorkArea}, Path=Width}"
Height="{Binding Source={x:Static SystemParameters.WorkArea}, Path=Height}"
I found this great solution
<Window WindowStyle="None" WindowStartupLocation="CenterScreen" WindowState="Maximized"
MaxWidth="{Binding Source={x:Static SystemParameters.WorkArea}, Path=Width}"
MaxHeight="{Binding Source={x:Static SystemParameters.WorkArea}, Path=Height}"
>
...
</Window>
But error for me still persists, windows is offset by few pixels on top and left... I tried to set Left and Top to 0 after I change window state but nothing happens.