/// <summary> /// Hide the menu after temporarily showing it /// </summary> /// <param name="sender"></param> /// <param name="e"></param> private void MainMenuPanel_MouseEnter(object sender, System.Windows.Input.MouseEventArgs e) { if (MenuHidden) { ShowMenuStoryboard.Begin(); } }
/// <summary> /// Toggle between showing the main menu and hiding it /// </summary> /// <param name="state">null,Show,Hide,InstaHide</param> private void ToggleMainMenu(string state) { switch (state) { case "Show": ShowMenuStoryboard.Begin(); MenuShowButton.Visibility = Visibility.Collapsed; MenuHideButton.Visibility = Visibility.Visible; MainMenu.SetValue(Grid.ColumnSpanProperty, 1); MenuHidden = false; break; case "Hide": HideMenuStoryboard.Begin(); MenuShowButton.Visibility = Visibility.Visible; MenuHideButton.Visibility = Visibility.Collapsed; MainMenu.SetValue(Grid.ColumnSpanProperty, 2); MenuHidden = true; break; case "Instahide": MainMenu.SetValue(WidthProperty, 20.0); MenuShowButton.Visibility = Visibility.Visible; MenuHideButton.Visibility = Visibility.Collapsed; MainMenu.SetValue(Grid.ColumnSpanProperty, 2); MenuHidden = true; break; default: if (MenuHidden) { ShowMenuStoryboard.Begin(); MenuShowButton.Visibility = Visibility.Collapsed; MenuHideButton.Visibility = Visibility.Visible; MainMenu.SetValue(Grid.ColumnSpanProperty, 1); MenuHidden = false; } else { HideMenuStoryboard.Begin(); MenuShowButton.Visibility = Visibility.Visible; MenuHideButton.Visibility = Visibility.Collapsed; MainMenu.SetValue(Grid.ColumnSpanProperty, 2); MenuHidden = true; } break; } }