/// <summary> /// 打开window /// </summary> /// <param name="btnName"></param> private void OpenWindow(string btnName) { Window showWin = null; switch (btnName) { case "MenuAbout": showWin = new AboutWindow(); break; case "MenuJSPanel": showWin = new CodePanelWin(); break; case "MenuRedis": showWin = new RedisWin(); break; case "MenuSettings": showWin = new SettingWin(); break; case "MenuHttp": showWin = new HttpRequesterWin(); break; case "MenuColor": showWin = new ChangeThemeColorWin(); break; } showWins.Add(showWin); showWin.Closing += ChildWindow_Closing; showWin.Show(); }
/// <summary> /// 打开window /// </summary> /// <param name="menuName"></param> private void OpenWindow(string menuName) { Window showWin = null; if (!HasWindowOpened(menuName, ref showWin)) { switch (menuName) { case "MenuAbout": showWin = new AboutWin(); break; case "MenuCodePanel": showWin = new CodePanelWin(); break; case "MenuRedis": showWin = new RedisWin(); break; case "MenuSettings": showWin = new SettingWin(); break; case "MenuHttp": showWin = new HttpRequesterWin(); break; case "MenuQuestions": showWin = new QuestionsWin(); break; case "MenuColor": showWin = new ChangeThemeColorWin(); break; case "MenuPortScaner": showWin = new PortScanWin(); break; } showWins.Add(showWin); showWin.Closing += ChildWindow_Closing; showWin.Show(); } else { showWin.Activate(); } }