From 5225145f677962b0870e506587b9fd23b98d0a51 Mon Sep 17 00:00:00 2001 From: Yan Maniez Date: Sat, 7 Dec 2019 18:06:51 +0100 Subject: [PATCH] Corrections bouton back popup --- AideDeJeu/AideDeJeu.Android/MainActivity.cs | 4 ++-- AideDeJeu/AideDeJeu/ViewModels/Navigator.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/AideDeJeu/AideDeJeu.Android/MainActivity.cs b/AideDeJeu/AideDeJeu.Android/MainActivity.cs index b12c9ac1..57e72093 100644 --- a/AideDeJeu/AideDeJeu.Android/MainActivity.cs +++ b/AideDeJeu/AideDeJeu.Android/MainActivity.cs @@ -84,7 +84,7 @@ namespace AideDeJeu.Droid // .SetMessage(Xamarin.Forms.Shell.Current.CurrentItem.Route) // .SetTitle("OnBackPressed") // .Show(); - if (Xamarin.Forms.Shell.Current.Navigation.NavigationStack.Count == 1 && Xamarin.Forms.Shell.Current.CurrentItem.Route != "IMPL_home") + if (Xamarin.Forms.Shell.Current?.Navigation?.NavigationStack?.Count == 1 && Rg.Plugins.Popup.Services.PopupNavigation.Instance.PopupStack.Count == 0 && Xamarin.Forms.Shell.Current?.CurrentItem?.Route != "IMPL_home") { Xamarin.Forms.Shell.Current.GoToAsync("//home", true); } @@ -93,7 +93,7 @@ namespace AideDeJeu.Droid if (Rg.Plugins.Popup.Popup.SendBackPressed(base.OnBackPressed)) { // Do something if there are some pages in the `PopupStack` - //Rg.Plugins.Popup.Services.PopupNavigation.Instance.PopAsync(); + Rg.Plugins.Popup.Services.PopupNavigation.Instance.PopAsync(); } else { diff --git a/AideDeJeu/AideDeJeu/ViewModels/Navigator.cs b/AideDeJeu/AideDeJeu/ViewModels/Navigator.cs index a80a6df3..f14664cd 100644 --- a/AideDeJeu/AideDeJeu/ViewModels/Navigator.cs +++ b/AideDeJeu/AideDeJeu/ViewModels/Navigator.cs @@ -186,7 +186,7 @@ namespace AideDeJeu.ViewModels var repo = Main.Bookmarks; var vm = new BookmarksViewModel(); var result = await Application.Current.MainPage.DisplayActionSheet("Ajouter à", "Annuler", "Nouvelle liste", repo.BookmarkCollectionNames.ToArray()); - if (result != "Annuler") + if (result != "Annuler" && result != null) { if (result == "Nouvelle liste") {