更新时间:2021-09-23 03:28:49
尝试在你的 MainPage
的 constructor 中设置 PreferredLaunchViewSize
像这样:
Try setting PreferredLaunchViewSize
in your MainPage
's constructor like this:
public MainPage()
{
this.InitializeComponent();
ApplicationView.PreferredLaunchViewSize = new Size(480, 800);
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
}
正如@kol 还指出的,如果您想要任何小于默认 500x320 的尺寸,您需要手动重置它:
As @kol 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));