How to achieve an automatic full screen that not hides the taskbar, with no resize and no window style?
I tried to use the following code, but it doesn't work right, as shown in the image below.
XAML:
<Window x:Class="WPF_Test_Environment.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
WindowState="Maximized" ResizeMode="NoResize" WindowStyle="None">
<DockPanel>
<Button DockPanel.Dock="Top" Height="50">Top</Button>
<Button DockPanel.Dock="Bottom" Height="50">Bottom</Button>
<Button DockPanel.Dock="Left" Width="50">Left</Button>
<Button DockPanel.Dock="Right" Width="50">Right</Button>
<Button Width="50" Height="50">Center</Button>
</DockPanel>
</Window>
Code-Behind:
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
MaxHeight = SystemParameters.MaximizedPrimaryScreenHeight;
MinHeight = SystemParameters.MaximizedPrimaryScreenHeight;
MaxWidth = SystemParameters.MaximizedPrimaryScreenWidth;
MinWidth = SystemParameters.MaximizedPrimaryScreenWidth;
}
}
Here is the result:
As you can see, the "Bottom" button is partially underneath the taskbar, and I want it to be entirely above it. So, ideally, it would look as shown in the following image, but without the border on the top: