You can use another PreferredLaunchViewSize value from ApplicationViewWindowingMode and then set ApplicationView.PreferredLaunchViewSize , but the key is to figure out what size it will be.
Theoretically, you could use a really large number, and the window would simply expand to the maximum possible. However, it is probably safer to simply calculate screen sizes in effective pixels.
So, if you just call the following method before InitializeComponent(); on its main Page , it should maximize the window at startup.
private static void MaximizeWindowOnLoad() {
Please note that the application somehow remembers these settings even after deleting it. If you want to return to the default behavior (the application starts with the previous window size), just call ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.Auto; once and delete all the code.
Update
It appears that in the latest version of Windows 10, ApplicationView.GetForCurrentView().VisibleBounds no longer returns the full window size in effective pixels. So now we need a new way to calculate it.
This is quite simple, since the DisplayInformation class also gives us screen resolution as well as a scale factor.
Below is the updated code -
public MainPage() { MaximizeWindowOnLoad(); InitializeComponent(); void MaximizeWindowOnLoad() { var view = DisplayInformation.GetForCurrentView();
source share