I have created a borderless application in WPF, and it works pretty good. However, when I set the WindowState to full screen, the application takes up more space than my screen resolution, so there are some pixels outside the screen in all directions! (looks like some hard coded negative margins are added to hide the default border)
Any Ideas how to prevent this from happening?
My xaml:
<Window x:Class="MyApp.Shell"
WindowStyle="None"
BorderThickness="0"
AllowsTransparency="True"
Background="Transparent"
ResizeMode="CanResizeWithGrip"
WindowState="{Binding MainApplicationWindowState}"
...
Also, another problem I have seen is that the Windows toolbar / taskbar is covered in the fullsize state, so it looks like the "actual" screen height is used and not the "available" screen height, meaning screen height minus the windows toolbar / taskbar!
Anyone found a solution to these issues?
Thanks
I use a trigger on the window:
this trigger create a Border when the windowstate is Maximized. I think it's useful.
In Xaml set the following binding on the
Window.MaxHeight
:No need for an additional utility class.
I found this great solution
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.
In my case the XAML tag of the Window had the Property SizeToContent="True" and all I had to do was to remove it.
I needed this to work across different size displays (like most people it sounds). So I simply did this...
A newer feature of .NET has solved this problem. Leave your
WindowStyle="SingleBorderWindow"
or"ThreeDBorderWindow"
LeaveResizeMode="CanResize"
, then add this to the xaml inside theThe window will not have any of the default window pane, but will still allow resizing and will not cover the task bar when maximized.