public void NextItem() { m_rgItems[(int)m_pSelectedItem].Selected = false; m_pSelectedItem++; if ((int)m_pSelectedItem > 4) m_pSelectedItem = MainMenuItems.NEWGAME; m_rgItems[(int)m_pSelectedItem].Selected = true; }
public void AddMainMenuItem(MenuItem menuItem) { MainMenuItems.Add(menuItem); if (menuItem.DisplayOnHome) { HomeMenuItems.Add(menuItem); } }
private void AppFrame_Navigated(object sender, NavigationEventArgs e) { if (AppFrame.CanGoBack) { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Visible; } else { SystemNavigationManager.GetForCurrentView().AppViewBackButtonVisibility = AppViewBackButtonVisibility.Collapsed; } int idx = MainMenuItems.FindIndex(item => item.PageType == e.SourcePageType); if (idx >= 0) { HamBurgerMenu.SelectedIndex = idx; } if (e.SourcePageType != typeof(WeatherNow)) { HamburgerButtonColor = App.AppColor; if (ApiInformation.IsTypePresent("Windows.UI.ViewManagement.StatusBar")) { // Mobile StatusBar.GetForCurrentView().BackgroundColor = HamburgerButtonColor; } else { // Desktop var titlebar = ApplicationView.GetForCurrentView().TitleBar; titlebar.BackgroundColor = HamburgerButtonColor; titlebar.ButtonBackgroundColor = titlebar.BackgroundColor; } } if (AppFrame.Content is ICommandBarPage cmdBarPage) { CommandBarTitle.Text = cmdBarPage.CommandBarLabel; CommandBar.PrimaryCommands.Clear(); if (cmdBarPage.PrimaryCommands != null) { cmdBarPage.PrimaryCommands.ForEach(cmd => CommandBar.PrimaryCommands.Add(cmd)); } } else { CommandBarTitle.Text = "SimpleWeather"; CommandBar.PrimaryCommands.Clear(); } }
private void NavigationComplete(NavigationResult result) { MainMenuIsOpen = false; ModuleTitle = MainMenuItems.Where(m => m.NavigatePath == result.Context.Uri.ToString()).FirstOrDefault().Title; }
public void PreviousItem() { m_rgItems[(int)m_pSelectedItem].Selected = false; m_pSelectedItem--; if ((int)m_pSelectedItem < 0) m_pSelectedItem = MainMenuItems.QUIT; m_rgItems[(int)m_pSelectedItem].Selected = true; }
private void LoadScreen(MainMenuItems pItem) { AvailableScreens pScreen = AvailableScreens.MAINMENU; switch (pItem) { case MainMenuItems.NEWGAME: pScreen = AvailableScreens.GAMEPLAY; break; case MainMenuItems.HIGHSCORE: pScreen = AvailableScreens.HIGHSCORE; break; case MainMenuItems.OPTIONS: pScreen = AvailableScreens.OPTIONS; break; case MainMenuItems.CREDITS: pScreen = AvailableScreens.CREDITS; break; case MainMenuItems.QUIT: m_pParent.Exit(); break; } m_pParent.LoadScreen(pScreen); }
public MainMenuItem(MainMenuItems pItem, string szName, bool bSelected, MainMenu pParent) { m_pParent = pParent; m_pItem = pItem; m_szName = szName; m_bSelected = bSelected; Vector2 pStringSize = pParent.Font.MeasureString(m_szName); m_pPosition.X = (200); //1280 / 2 - (pStringSize.X / 2) m_pPosition.Y = 200 + ((int)pItem * 30); }
public void AddMainMenuItem(MenuItem menuItem, EventHandler <MenuItemClickedEventArgs> menuEventHandler) { _mainMenuEventHandlers.Add(menuItem, menuEventHandler); MainMenuItems.Add(menuItem); }
private string ResolveItemLabel(MainMenuItems item) { switch(item) { case MainMenuItems.AboutEDMC: return "About EDMC"; default: return "About EDMC"; } }
public WebControl SpecificNavListItems(MainMenuItems item) { return GetChildren().Where(control => control.Text.Equals(ResolveItemLabel(item))).FirstOrDefault(); }