From ba64d0243479822a8970ab8b0574e775a2a1b35f Mon Sep 17 00:00:00 2001 From: Yan Maniez Date: Thu, 20 Sep 2018 13:44:01 +0200 Subject: [PATCH] Behavior --- .../ViewModels/BookmarksViewModel.cs | 19 ++++++++++++++++++- AideDeJeu/AideDeJeu/Views/BookmarksPage.xaml | 7 ++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/AideDeJeu/AideDeJeu/ViewModels/BookmarksViewModel.cs b/AideDeJeu/AideDeJeu/ViewModels/BookmarksViewModel.cs index 11c167db..0286a0e1 100644 --- a/AideDeJeu/AideDeJeu/ViewModels/BookmarksViewModel.cs +++ b/AideDeJeu/AideDeJeu/ViewModels/BookmarksViewModel.cs @@ -38,7 +38,7 @@ namespace AideDeJeu.ViewModels set { SetProperty(ref _BookmarkCollectionIndex, value); - LoadBookmarkCollection(BookmarkCollectionNames[BookmarkCollectionIndex]); + //LoadBookmarkCollection(BookmarkCollectionNames[BookmarkCollectionIndex]); } } private ObservableCollection _BookmarkCollection = new ObservableCollection(); @@ -54,6 +54,23 @@ namespace AideDeJeu.ViewModels } } + private ICommand _SelectedIndexChangedCommand = null; + public ICommand SelectedIndexChangedCommand + { + get + { + return _SelectedIndexChangedCommand ?? (_SelectedIndexChangedCommand = new Command(async() => await ExecuteSelectedIndexChangedCommand())); + } + } + + private async Task ExecuteSelectedIndexChangedCommand() + { + if (BookmarkCollectionIndex >= 0 && BookmarkCollectionIndex < BookmarkCollectionNames.Count) + { + //BookmarkCollectionIndex = index; + await LoadBookmarkCollection(BookmarkCollectionNames[BookmarkCollectionIndex]); + } + } private ICommand _GotoItemCommand = null; public ICommand GotoItemCommand diff --git a/AideDeJeu/AideDeJeu/Views/BookmarksPage.xaml b/AideDeJeu/AideDeJeu/Views/BookmarksPage.xaml index 291e8438..b11d8853 100644 --- a/AideDeJeu/AideDeJeu/Views/BookmarksPage.xaml +++ b/AideDeJeu/AideDeJeu/Views/BookmarksPage.xaml @@ -10,6 +10,7 @@ + @@ -25,7 +26,11 @@ - + + + + +