

One of the answers gives a way to set that very first launch size (reverting to Auto after that). However, from this question on MSDN, there may be a way to overcome this.

This calculation is needed, because the size is in DPI, so you have to convert it from pixels to DPI.Īlso keep in mind that size cannot be smaller than "320x200".įor the very first app launch, the ApplicationView.PreferredLaunchWindowingMode is set to ApplicationViewWindowingMode.Auto regardless of what you set in your code. In the "desiredSize" calculation, 800 is the width and 600 is the height. It is better if you place this code into the "OnActivated()" event handler as it will set your defined size when the app starts and when it becomes active after any interruptions. Windows.UI. = desiredSize īool result = Windows.UI.().TryResizeView(desiredSize) I've asked the same question on MSDN forums and got the answer here:īTW, here is the solution in your event handler "OnLaunched" or in your Event Handler "OnActivated" find: () Īnd replace it with: float DPI = .GetForCurrentView().LogicalDpi You don't really have control over the window size, and even if you will try to re-size it it may fail. Try setting PreferredLaunchViewSize in your MainPage's constructor like this: public MainPage()ĪpplicationView.PreferredLaunchViewSize = new Size(480, 800) ĪpplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize Īs also pointed out, if you want any size smaller than the default 500x320, you will need to manually reset it: ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(200, 100))
