/// <summary> /// Hides all except one /// </summary> /// <param name="section">One to keep open</param> protected void HideAllExcept(UISection section) { var cacheState = section.IsToggled; HideAllSections(); if (cacheState) { ToggledSection(section); } }
/// <summary> /// Hide/Un-hide specific section /// </summary> /// <param name="section"></param> protected void ToggledSection(UISection section) { section.IsToggled = !section.IsToggled; section.UiControllers.ForEach(controller => controller.Toggle(section.IsToggled)); }