示例#1
0
 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);
     }
 }
示例#3
0
        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;
 }
示例#5
0
 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;
 }
示例#6
0
        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);
        }
示例#7
0
 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);
 }
示例#8
0
 public void AddMainMenuItem(MenuItem menuItem, EventHandler <MenuItemClickedEventArgs> menuEventHandler)
 {
     _mainMenuEventHandlers.Add(menuItem, menuEventHandler);
     MainMenuItems.Add(menuItem);
 }
示例#9
0
        private string ResolveItemLabel(MainMenuItems item)
        {
            switch(item)
            {
                case MainMenuItems.AboutEDMC:
                    return "About EDMC";

                default:
                    return "About EDMC";
            }
        }
示例#10
0
 public WebControl SpecificNavListItems(MainMenuItems item) {
     return GetChildren().Where(control => control.Text.Equals(ResolveItemLabel(item))).FirstOrDefault();
 }