How can I maximize the WPF page when the application starts?

I have a simple WPF application with two xaml pages. I would like to open the application with the maximum screen size. I only found answers about Windows WPF, but for Pages there is no WindowState property.

Thank you so much!

+4
source share
2 answers

In the Xaml window definition, simply specify:

WindowStartupLocation="CenterScreen" WindowState="Maximized"
+6
source

You can set the properties Widthand Heightmanually according to your current screen resolution here

System.Windows.SystemParameters.PrimaryScreenWidth;
System.Windows.SystemParameters.PrimaryScreenHeight;
0
source

All Articles