wpf 判断项目中的某个窗体是否已经打开或者已经存在 foreach (Window item in Application.Current.Windows) { if (item is window1) return; }