WPF 每次只打开一个窗口
if(downListControl == null || downListControl.IsVisible == false) { downListControl = new DownloadListControl(); downListControl.Show(); } else { MessageBox.Show("对不起,下载窗口也打开!不要重复打开"); downListControl.Activate(); downListControl.WindowState = WindowState.Normal; }
PS:downListControl 是窗口的实例对象名