private void NavigationOnTransition(NavigationButtonsController.ButtonType type) { if (currentPanel && currentPanel.Type == type) { return; } if (currentPanel) { currentPanel.Hide(); } currentPanel = Panels[type]; currentPanel.Show(); }
/// <summary> /// 显示或隐藏面板 /// </summary> /// <param name="s">面板名称</param> /// <param name="active">显示或隐藏</param> public static void TogglePanel(string s, bool active) { BasePanel p = GetPanel <BasePanel>(s); if (active) { p.Show(); } else { p.Hide(); } }
/// <summary> /// 关闭界面 /// </summary> /// <typeparam name="T">界面类</typeparam> public void HidePanel <T>() where T : BasePanel { BasePanel panel = null; var panelName = typeof(T).ToString(); if (m_panels.ContainsKey(panelName)) { panel = m_panels[panelName]; } if (null != panel) { panel.Hide(); } }