获取主窗口的引用:Window main=Application.Current.MainWindow获取程序中打开的所有窗口:Application.Currrent.Windows(在一个自定义应用程序类中保存那些需要用到的窗口的引用可能更有意义)