public async void SelectItem(object model) { var item = model as MenuPageItem; if (item != null) { if (item.TargetType == typeof(ProfilePage)) { this.GoToProfilePage(); } if (item.TargetType == typeof(SelectPage)) { App.Current.MainPage = this.NavigationService.ShowViewModelAsMainPageWithMenu <SelectViewModel>(); } if (item.TargetType == typeof(QrReservation)) { this.scanPage = new ZXingScannerPage(); this.scanPage.OnScanResult += this.HandleScanResult; this.selected = null; await this.navigationService.XamarinNavigation.PushAsync(this.scanPage); } } }
public static ObservableCollection <MenuPageItem> GetMenuEmpresaItens() { menuLista = new ObservableCollection <MenuPageItem>(); var pagina1 = new MenuPageItem() { Title = "Alunos", Icon = "AlunosIcon", TargetType = typeof(AlunosPage) }; var pagina2 = new MenuPageItem() { Title = "Escolas", Icon = "EscolaIcon", TargetType = typeof(EscolasPage) }; var pagina3 = new MenuPageItem() { Title = "Sair", Icon = "LogoutIcon", TargetType = typeof(LoginPage) }; menuLista.Add(pagina1); menuLista.Add(pagina2); menuLista.Add(pagina3); return(menuLista); }
public MainPage() { InitializeComponent(); MenuList = new List <MenuPageItem>(); var Page1 = new MenuPageItem() { Title = "Home", Icon = "home.png", TargetType = typeof(MainPage) }; var Page2 = new MenuPageItem() { Title = "Gym Workout", Icon = "gym.png", TargetType = typeof(gymworkout) }; var Page3 = new MenuPageItem() { Title = "Home Workout", Icon = "homew.png", TargetType = typeof(homeworkout) }; var Page4 = new MenuPageItem() { Title = "Trainers", Icon = "trainer.png", TargetType = typeof(chooseTrainer) }; var Page5 = new MenuPageItem() { Title = "BMI Calculator", Icon = "bmi.png", TargetType = typeof(bmicalc) }; var Page6 = new MenuPageItem() { Title = "User Stories", Icon = "userStories.png", TargetType = typeof(TrainerPage) }; var Page7 = new MenuPageItem() { Title = "User Diet", Icon = "diet.png", TargetType = typeof(dietplan) }; MenuList.Add(Page1); MenuList.Add(Page2); MenuList.Add(Page3); MenuList.Add(Page4); MenuList.Add(Page5); MenuList.Add(Page6); MenuList.Add(Page7); navigationDrawerList.ItemsSource = MenuList; //Detail= new NavigationPage((Page) Activator.CreateInstance(typeof(gymworkout))); this.BindingContext = new { Header = "", Image = "p.jpg", Footer = "Welcome to Fitness4U" }; //IsPresented = false; }