From 7479433922bef249534049b6402c4d1ee9950120 Mon Sep 17 00:00:00 2001 From: Yan Maniez Date: Fri, 27 Sep 2019 19:11:14 +0200 Subject: [PATCH] Tests push/pop --- AideDeJeu/AideDeJeu/App.xaml.cs | 1 + AideDeJeu/AideDeJeu/ViewModels/Navigator.cs | 2 +- AideDeJeu/AideDeJeu/Views/Library/ItemPage.xaml.cs | 10 +++++----- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/AideDeJeu/AideDeJeu/App.xaml.cs b/AideDeJeu/AideDeJeu/App.xaml.cs index aeed2657..89b6fea5 100644 --- a/AideDeJeu/AideDeJeu/App.xaml.cs +++ b/AideDeJeu/AideDeJeu/App.xaml.cs @@ -4,6 +4,7 @@ using AideDeJeu.ViewModels.Library; using AideDeJeu.ViewModels.PlayerCharacter; using AideDeJeu.Views; using AideDeJeuLib; +using System.Diagnostics; using System.Linq; using System.Threading.Tasks; using Xamarin.Forms; diff --git a/AideDeJeu/AideDeJeu/ViewModels/Navigator.cs b/AideDeJeu/AideDeJeu/ViewModels/Navigator.cs index b7f24668..e76562d9 100644 --- a/AideDeJeu/AideDeJeu/ViewModels/Navigator.cs +++ b/AideDeJeu/AideDeJeu/ViewModels/Navigator.cs @@ -239,7 +239,7 @@ namespace AideDeJeu.ViewModels public async Task NavigateToLinkAsync(string s) { - await Shell.Current.GoToAsync($"item?path={s}"); + await Shell.Current.Navigation.PushAsync(new ItemPage(s), true);//.GoToAsync($"item?path={Uri.EscapeDataString(s)}"); return; if (s != null) { diff --git a/AideDeJeu/AideDeJeu/Views/Library/ItemPage.xaml.cs b/AideDeJeu/AideDeJeu/Views/Library/ItemPage.xaml.cs index b352ac71..d2ab29fd 100644 --- a/AideDeJeu/AideDeJeu/Views/Library/ItemPage.xaml.cs +++ b/AideDeJeu/AideDeJeu/Views/Library/ItemPage.xaml.cs @@ -49,10 +49,10 @@ namespace AideDeJeu.Views.Library public ItemPage(string id) { - Path = id; BindingContext = this; InitializeComponent(); - LoadPageAsync(); + Path = id; + //LoadPageAsync(); } protected override void OnAppearing() @@ -78,7 +78,7 @@ namespace AideDeJeu.Views.Library private async Task LoadPageAsync() { var regex = new Regex("/?(?.*?)(_with_(?.*))?\\.md(#(?.*))?"); - var match = regex.Match(Path); + var match = regex.Match(Uri.UnescapeDataString(Path)); var file = match.Groups["file"].Value; var anchor = match.Groups["anchor"].Value; var with = match.Groups["with"].Value; @@ -126,13 +126,13 @@ namespace AideDeJeu.Views.Library backingStore = value; onChanged?.Invoke(); - OnPropertyChanged(propertyName); + CallOnPropertyChanged(propertyName); return true; } #region INotifyPropertyChanged public event PropertyChangedEventHandler PropertyChanged; - protected void OnPropertyChanged([CallerMemberName] string propertyName = "") + protected void CallOnPropertyChanged([CallerMemberName] string propertyName = "") { var changed = PropertyChanged; if (changed == null)