When creating a WPF window with AllowsTransparency=\"True\" WindowStyle=\"None\"
and maximizing it via this.WindowState = WindowState.Maximized;
the Wi
If you only care about the correct dimensions of your window and have no trouble with the appearance, you can wrap the contents of the window in System.Windows.Controls.Canvas
like this:
Then you can use MyCanvas.ActualWidth
and MyCanvas.ActualHeight
to get the resolution of the current screen, with DPI settings taken into account and in device independent units.
It doesn't add any margins like the maximized window itself does.
It should work with multiple monitors too.
(Canvas accepts UIElement
s as children, so you should be able to use it with any content.)