Exemplo n.º 1
0
 protected async override void OnAppearing()
 {
     try
     {
         if (await UsuarioServicio.EstadologinAsync())
         {
             await Navigation.PopModalAsync();
         }
         base.OnAppearing();
     }
     catch (Exception ex)
     {
         await DisplayAlert("Login", ex.ToString(), "OK");
     }
 }
Exemplo n.º 2
0
        private async void ListMenu_ItemSelected(object sender, SelectedItemChangedEventArgs e)
        {
            var menu = e.SelectedItem as MenuApp;

            if (menu != null)
            {
                if (menu.MenuTitle == "Perfil")
                {
                    if (!await UsuarioServicio.EstadologinAsync())
                    {
                        //Detail = new NavigationPage(new LoginPagina());
                        await Navigation.PushModalAsync(new LoginPagina());

                        IsPresented = false;
                        return;
                    }
                    else
                    {
                        await Navigation.PushModalAsync(new MisDatosPage());

                        IsPresented = false;
                        return;
                    }
                }

                if (menu.MenuTitle == "Mis pedidos")
                {
                    MainPageViewModel.MisOrdenesCommand.Execute(true);

                    IsPresented = false;
                    return;
                }

                Detail      = new NavigationPage(menu.Page);
                IsPresented = false;
                //Detail = new NavigationPage(new CategoriaPage { BindingContext=MainPageViewModel });
                //MainPageViewModel.OpcionMenuCommand.Execute(menu.Page);

                //Detail.Navigation.PopModalAsync(menu.Page);
                //await Navigation.PushAsync(new menu.Page);
            }
        }