[英]How do I set the default size of a new window in WPF?
I am creating a WPF application. 我正在创建一个WPF应用程序。 All the windows I'm using are 1980x1080. 我正在使用的所有窗口都是1980x1080。
However, whenever I create a new window the default size of it is 300x300. 但是,每当我创建一个新窗口时,它的默认大小为300x300。
It is quite annoying to have to change it every time, so I am wondering if there is a way to set the default new window size. 每次都要改变它是非常烦人的,所以我想知道是否有办法设置默认的新窗口大小。
I am using Visual Studio 2017. Thanks in advance. 我正在使用Visual Studio 2017.提前感谢。
You can put the size you want in the XAML file and export a new template from: File->Export Template
and choose Item Template. 您可以将所需大小放在XAML文件中并从以下位置导出新模板: File->Export Template
然后选择项模板。
Then when you want to add a new window, you choose your custom template instead of the default. 然后,当您要添加新窗口时,可以选择自定义模板而不是默认模板。
More details can be found in the documentation . 更多细节可以在文档中找到。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.