Ejemplo n.º 1
0
        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")
            });
        }
Ejemplo n.º 2
0
        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);
        }
Ejemplo n.º 3
0
 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>();
 }
Ejemplo n.º 4
0
 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);
     }
 }
Ejemplo n.º 5
0
        public App()
        {
            InitializeComponent();

            LoadDataBase();
            RegisterPages();

            if (AuthenticationService.LoggedUser == null)
            {
                MainPage = new NavigationPage(ViewsManager.CreateView <LoginViewModel>());
            }
            else
            {
                MainPage = new MainMenuPage();
            }
        }