C# 主窗口中的WPF窗口
我几乎没有WPF窗口 当我想打开一个新窗口时,我将关闭当前窗口,并加载一个新窗口:C# 主窗口中的WPF窗口,c#,wpf,C#,Wpf,我几乎没有WPF窗口 当我想打开一个新窗口时,我将关闭当前窗口,并加载一个新窗口: ProductMain productMain= new ProductMain(); productMain.Show(); this.Close(); 我知道你们可以把用户控件放到窗口中 我可以在主窗口中加载窗口吗 谢谢。您可以通过设置窗口的所有者属性来执行类似操作。要获取主窗口,请使用: Application.Current.MainWindow 之后,您可以设置ProductMain窗口的: Pr
ProductMain productMain= new ProductMain();
productMain.Show();
this.Close();
我知道你们可以把用户控件放到窗口中
我可以在主窗口中加载窗口吗
谢谢。您可以通过设置窗口的所有者属性来执行类似操作。要获取主窗口,请使用:
Application.Current.MainWindow
之后,您可以设置ProductMain窗口的:
ProductMain productMain= new ProductMain();
productMain.Owner = Application.Current.MainWindow;
productMain.Show();