0

I am writing a small UWP app which is going to be launched from another app (the main app). I am hoping to decrease the window size of the UWP app.

I was able to change the window size by adding the code commented below into the App constructor. But I couldn't figure out how to make the UWP app center screen after I changed the window size. Any advices on making the UWP center screen is appreciated.

public App()
{
    this.InitializeComponent();
    this.Suspending += OnSuspending;
    ApplicationView.PreferredLaunchViewSize = new Size(600, 400); //added code
    ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize; //added code
} 
Tracy Zhou
  • 714
  • 1
  • 7
  • 11

1 Answers1

1

Is there a way to resize and center a UWP app?

No, I am afraid there is no API to set the positon of the UWP window:

[UWP] Change the position of window close proximity to the right edge of the screen

UWP Window Placement

How can I set the Windows position on startup

mm8
  • 163,881
  • 10
  • 57
  • 88