Setting window size on desktop for a Windows 10 UWP app

Try setting PreferredLaunchViewSize in your MainPage‘s constructor like this:

public MainPage()
{
    this.InitializeComponent();

    ApplicationView.PreferredLaunchViewSize = new Size(480, 800);
    ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
}

As @kol also pointed out, if you want any size smaller than the default 500×320, you will need to manually reset it:

ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(200, 100));

Leave a Comment

tech