MarianoDiego
MarianoDiego

Reputation: 171

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

I have a simple WPF application with two xaml Pages. I'd like the app opening with the maximum size of the screen. I've found only answers about WPF Windows, but for Pages there is not a "WindowState" property.

Thanks a lot!

Upvotes: 16

Views: 13543

Answers (2)

Hardgraf
Hardgraf

Reputation: 2626

In your Xaml window definition simply define:

WindowStartupLocation="CenterScreen" WindowState="Maximized"

Upvotes: 30

coder0815
coder0815

Reputation: 229

You could set the Width and Height property manually according to your current Screen Resolution from here

System.Windows.SystemParameters.PrimaryScreenWidth;
System.Windows.SystemParameters.PrimaryScreenHeight;

Upvotes: 1

Related Questions