Пример #1
0
 //Function for Viewing Items of Selected Group
 private void ViewSelectedMenu(M.MenuItem value)
 {
     try
     {
         SelectedItemsList = new ObservableCollection <M.MenuItem>(MenuItemsList.Where(x => x.PARENT == value.MCODE));
         CountOrderQuantity();
     }
     catch (Exception e)
     {
     }
 }
Пример #2
0
        private string displayMenu()
        {
            StringBuilder menuBuilder     = new StringBuilder();
            int           numberOfOptions = MenuItemsList.Count();
            int           optionNumber    = 1;

            foreach (MenuItem item in MenuItemsList)
            {
                menuBuilder.AppendLine(optionNumber + "." + item.ItemName);
                optionNumber++;
            }

            bool   isMainMenu = PreviousMenu == null;
            string backOrExit = isMainMenu ? k_ExitMessage : k_BackMessage;

            menuBuilder.AppendLine(backOrExit);
            menuBuilder.AppendLine(string.Format("please enter your choice (1 to {0}) or enter 0 for {1}"
                                                 , numberOfOptions, backOrExit));

            return(menuBuilder.ToString());
        }
        private async Task NavigateToPageAsync()
        {
            if (SelectedItem != null)
            {
                var index = MenuItemsList.IndexOf(SelectedItem);

                switch (index)
                {
                case 0:
                    var navResult = await NavigationService.NavigateAsync("NavigationPage/TabPageExample");

                    break;

                case 1:
                    navResult = await NavigationService.NavigateAsync("NavigationPage/" +
                                                                      "TabbedPageRuntime?" +
                                                                      "createTab=Tab1Page&" +
                                                                      "createTab=Tab2Page");

                    break;

                case 2:
                    navResult = await NavigationService.NavigateAsync("NavigationPage/TabModalPage", useModalNavigation : true);

                    break;

                case 3:

                    navResult = await NavigationService.NavigateAsync("NavigationPage/" +
                                                                      "TabbedPageRuntimeModal?" +
                                                                      "createTab=Tab1Page&" +
                                                                      "createTab=Tab2Page", useModalNavigation : true);

                    break;

                case 4:
                    navResult = await NavigationService.NavigateAsync("NavigationPage/Page1Page");

                    break;

                case 5:
                    App.Instance.ClearDetailNavStack = false;
                    navResult = await NavigationService.NavigateAsync("NavigationPage/Page1ClearStackNavPage");

                    App.Instance.ClearDetailNavStack = true;
                    break;

                case 6:
                    navResult = await NavigationService.NavigateAsync("NavigationPage/Page1ModalPage", useModalNavigation : true);

                    break;

                case 7:
                    navResult = await NavigationService.NavigateAsync("NavigationPage/MenuMasterDetailPage");

                    break;

                case 8:
                    navResult = await NavigationService.NavigateAsync("NavigationPage/TabbedMasterDetailPage");

                    break;

                case 9:
                    navResult = await NavigationService.NavigateAsync("/NavigationPage/MainPage");

                    break;
                }

                SelectedItem = null;
            }
        }