public MainMenuPage() { Children.Add(new NavigationPage(ViewsManager.CreateView <HomeViewModel>()) { Icon = "tab_home", Title = (Device.RuntimePlatform == Device.Android ? "" : "Home") }); Children.Add(new NavigationPage(ViewsManager.CreateView <CartViewModel>()) { Icon = "tab_cart", Title = (Device.RuntimePlatform == Device.Android ? "" : "Carrito") }); Children.Add(new NavigationPage(ViewsManager.CreateView <RentViewModel>()) { Icon = "tab_rent", Title = (Device.RuntimePlatform == Device.Android ? "" : "Escanear") }); Children.Add(new NavigationPage(ViewsManager.CreateView <ProfileViewModel>()) { Icon = "tab_profile", Title = (Device.RuntimePlatform == Device.Android ? "" : "Perfil") }); }
public virtual void NavigateTo(Type viewModelType, Dictionary <string, object> args) { var page = ViewsManager.CreateView(viewModelType); if (page is ContentPageBase) { ((ContentPageBase)page).ViewModel.InputArgs = args; } Navigation.PushAsync(page, true); }
void RegisterPages() { ViewsManager.Register <LoginViewModel, LoginPage>(); ViewsManager.Register <SignupViewModel, SignupPage>(); ViewsManager.Register <MainMenuViewModel, MainMenuPage>(); ViewsManager.Register <HomeViewModel, HomePage>(); ViewsManager.Register <MovieDetailViewModel, MovieDetailPage>(); ViewsManager.Register <CartViewModel, CartPage>(); ViewsManager.Register <RentViewModel, RentPage>(); ViewsManager.Register <ProfileViewModel, ProfilePage>(); }
public override void NavigateTo(Type viewModelType, Dictionary <string, object> args) { if (viewModelType == typeof(LoginViewModel)) { App.Current.MainPage = new NavigationPage(ViewsManager.CreateView(viewModelType)); } else { base.NavigateTo(viewModelType, args); } }
public App() { InitializeComponent(); LoadDataBase(); RegisterPages(); if (AuthenticationService.LoggedUser == null) { MainPage = new NavigationPage(ViewsManager.CreateView <LoginViewModel>()); } else { MainPage = new MainMenuPage(); } }