mirror of
				https://github.com/Nioux/AideDeJeu.git
				synced 2025-10-30 23:16:09 +00:00 
			
		
		
		
	Colmatage bookmarks
This commit is contained in:
		
							parent
							
								
									e34223173f
								
							
						
					
					
						commit
						72f450dab9
					
				
					 7 changed files with 135 additions and 80 deletions
				
			
		|  | @ -1,4 +1,5 @@ | ||||||
| using AideDeJeu.Pdf; | using AideDeJeu.Pdf; | ||||||
|  | using AideDeJeu.Repositories; | ||||||
| using AideDeJeu.ViewModels; | using AideDeJeu.ViewModels; | ||||||
| using AideDeJeu.ViewModels.Library; | using AideDeJeu.ViewModels.Library; | ||||||
| using AideDeJeu.ViewModels.PlayerCharacter; | using AideDeJeu.ViewModels.PlayerCharacter; | ||||||
|  | @ -22,7 +23,7 @@ namespace AideDeJeu | ||||||
| 
 | 
 | ||||||
|             DependencyService.Register<MainViewModel>(); |             DependencyService.Register<MainViewModel>(); | ||||||
|             DependencyService.Register<PdfService>(); |             DependencyService.Register<PdfService>(); | ||||||
|             DependencyService.Register<BookmarksViewModel>(); |             DependencyService.Register<BookmarksRepository>(); | ||||||
|             DependencyService.Register<StoreViewModel>(); |             DependencyService.Register<StoreViewModel>(); | ||||||
|             DependencyService.Register<PlayerCharacterEditorViewModel>(); |             DependencyService.Register<PlayerCharacterEditorViewModel>(); | ||||||
|             var vm = DependencyService.Get<MainViewModel>(); |             var vm = DependencyService.Get<MainViewModel>(); | ||||||
|  |  | ||||||
|  | @ -1,10 +1,51 @@ | ||||||
| using System; | using AideDeJeu.ViewModels; | ||||||
|  | using AideDeJeuLib; | ||||||
|  | using System; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
|  | using System.Collections.ObjectModel; | ||||||
| using System.Text; | using System.Text; | ||||||
| 
 | 
 | ||||||
| namespace AideDeJeu.Repositories | namespace AideDeJeu.Repositories | ||||||
| { | { | ||||||
|     public class BookmarksRepository |     public class BookmarksRepository : BaseViewModel | ||||||
|     { |     { | ||||||
|  |         public ObservableCollection<string> BookmarkCollectionNames { get; set; } = new ObservableCollection<string>() | ||||||
|  |         { | ||||||
|  |             "Général", | ||||||
|  |             "Grimoire", | ||||||
|  |             "Bestiaire", | ||||||
|  |             "Sac", | ||||||
|  |             "Nouvelle liste", | ||||||
|  |         }; | ||||||
|  | 
 | ||||||
|  |         private int _BookmarkCollectionIndex = 0; | ||||||
|  |         public int BookmarkCollectionIndex | ||||||
|  |         { | ||||||
|  |             get | ||||||
|  |             { | ||||||
|  |                 return _BookmarkCollectionIndex; | ||||||
|  |             } | ||||||
|  |             set | ||||||
|  |             { | ||||||
|  |                 SetProperty(ref _BookmarkCollectionIndex, value); | ||||||
|  |                 //LoadBookmarkCollection(BookmarkCollectionNames[BookmarkCollectionIndex]); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|  |         public Dictionary<string, ObservableCollection<Item>> _BookmarkCollections = new Dictionary<string, ObservableCollection<Item>>(); | ||||||
|  | 
 | ||||||
|  |         public  ObservableCollection<Item> _BookmarkCollection = new ObservableCollection<Item>(); | ||||||
|  |         public ObservableCollection<Item> BookmarkCollection | ||||||
|  |         { | ||||||
|  |             get | ||||||
|  |             { | ||||||
|  |                 return _BookmarkCollection; | ||||||
|  |             } | ||||||
|  |             set | ||||||
|  |             { | ||||||
|  |                 SetProperty(ref _BookmarkCollection, value); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|  | 
 | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -1,10 +1,13 @@ | ||||||
| using System; | using AideDeJeu.ViewModels; | ||||||
|  | using AideDeJeuLib; | ||||||
|  | using System; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
|  | using System.Collections.ObjectModel; | ||||||
| using System.Text; | using System.Text; | ||||||
| 
 | 
 | ||||||
| namespace AideDeJeu.Repositories | namespace AideDeJeu.Repositories | ||||||
| { | { | ||||||
|     public class LibraryRepository |     public class LibraryRepository : BaseViewModel | ||||||
|     { |     { | ||||||
|     } |     } | ||||||
| } | } | ||||||
|  |  | ||||||
|  | @ -1,4 +1,5 @@ | ||||||
| using AideDeJeu.ViewModels.Library; | using AideDeJeu.Repositories; | ||||||
|  | using AideDeJeu.ViewModels.Library; | ||||||
| using System; | using System; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| using System.ComponentModel; | using System.ComponentModel; | ||||||
|  | @ -17,11 +18,11 @@ namespace AideDeJeu.ViewModels | ||||||
|                 return DependencyService.Get<MainViewModel>(); |                 return DependencyService.Get<MainViewModel>(); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         public BookmarksViewModel Bookmarks |         public BookmarksRepository Bookmarks | ||||||
|         { |         { | ||||||
|             get |             get | ||||||
|             { |             { | ||||||
|                 return DependencyService.Get<BookmarksViewModel>(); |                 return DependencyService.Get<BookmarksRepository>(); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         public StoreViewModel Store |         public StoreViewModel Store | ||||||
|  |  | ||||||
|  | @ -1,4 +1,5 @@ | ||||||
| using AideDeJeuLib; | using AideDeJeu.Repositories; | ||||||
|  | using AideDeJeuLib; | ||||||
| using System; | using System; | ||||||
| using System.Collections.Generic; | using System.Collections.Generic; | ||||||
| using System.Collections.ObjectModel; | using System.Collections.ObjectModel; | ||||||
|  | @ -16,49 +17,56 @@ namespace AideDeJeu.ViewModels.Library | ||||||
| { | { | ||||||
|     public class BookmarksViewModel : BaseViewModel |     public class BookmarksViewModel : BaseViewModel | ||||||
|     { |     { | ||||||
|  |         public BookmarksRepository Repository | ||||||
|  |         { | ||||||
|  |             get | ||||||
|  |             { | ||||||
|  |                 return DependencyService.Get<BookmarksRepository>(); | ||||||
|  |             } | ||||||
|  |         } | ||||||
|         public BookmarksViewModel() |         public BookmarksViewModel() | ||||||
|         { |         { | ||||||
|             //LoadBookmarkCollectionAsync(BookmarkCollectionNames[BookmarkCollectionIndex]).ConfigureAwait(true); |             //LoadBookmarkCollectionAsync(BookmarkCollectionNames[BookmarkCollectionIndex]).ConfigureAwait(true); | ||||||
|             LoadBookmarkCollectionsAsync().ConfigureAwait(true); |             LoadBookmarkCollectionsAsync().ConfigureAwait(true); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         public ObservableCollection<string> BookmarkCollectionNames { get; set; } = new ObservableCollection<string>() |         //public ObservableCollection<string> BookmarkCollectionNames { get; set; } = new ObservableCollection<string>() | ||||||
|         { |         //{ | ||||||
|             "Général", |         //    "Général", | ||||||
|             "Grimoire", |         //    "Grimoire", | ||||||
|             "Bestiaire", |         //    "Bestiaire", | ||||||
|             "Sac", |         //    "Sac", | ||||||
|             "Nouvelle liste", |         //    "Nouvelle liste", | ||||||
|         }; |         //}; | ||||||
| 
 | 
 | ||||||
|         private int _BookmarkCollectionIndex = 0; |         //private int _BookmarkCollectionIndex = 0; | ||||||
|         public int BookmarkCollectionIndex |         //public int BookmarkCollectionIndex | ||||||
|         { |         //{ | ||||||
|             get |         //    get | ||||||
|             { |         //    { | ||||||
|                 return _BookmarkCollectionIndex; |         //        return _BookmarkCollectionIndex; | ||||||
|             } |         //    } | ||||||
|             set |         //    set | ||||||
|             { |         //    { | ||||||
|                 SetProperty(ref _BookmarkCollectionIndex, value); |         //        SetProperty(ref _BookmarkCollectionIndex, value); | ||||||
|                 //LoadBookmarkCollection(BookmarkCollectionNames[BookmarkCollectionIndex]); |         //        //LoadBookmarkCollection(BookmarkCollectionNames[BookmarkCollectionIndex]); | ||||||
|             } |         //    } | ||||||
|         } |         //} | ||||||
| 
 | 
 | ||||||
|         private Dictionary<string, ObservableCollection<Item>> _BookmarkCollections = new Dictionary<string, ObservableCollection<Item>>(); |         //private Dictionary<string, ObservableCollection<Item>> _BookmarkCollections = new Dictionary<string, ObservableCollection<Item>>(); | ||||||
| 
 | 
 | ||||||
|         private ObservableCollection<Item> _BookmarkCollection = new ObservableCollection<Item>(); |         //private ObservableCollection<Item> _BookmarkCollection = new ObservableCollection<Item>(); | ||||||
|         public ObservableCollection<Item> BookmarkCollection |         //public ObservableCollection<Item> BookmarkCollection | ||||||
|         { |         //{ | ||||||
|             get |         //    get | ||||||
|             { |         //    { | ||||||
|                 return _BookmarkCollection; |         //        return _BookmarkCollection; | ||||||
|             } |         //    } | ||||||
|             set |         //    set | ||||||
|             { |         //    { | ||||||
|                 SetProperty(ref _BookmarkCollection, value); |         //        SetProperty(ref _BookmarkCollection, value); | ||||||
|             } |         //    } | ||||||
|         } |         //} | ||||||
| 
 | 
 | ||||||
|         private ICommand _SelectedIndexChangedCommand = null; |         private ICommand _SelectedIndexChangedCommand = null; | ||||||
|         public ICommand SelectedIndexChangedCommand |         public ICommand SelectedIndexChangedCommand | ||||||
|  | @ -71,24 +79,24 @@ namespace AideDeJeu.ViewModels.Library | ||||||
| 
 | 
 | ||||||
|         private async Task ExecuteSelectedIndexChangedCommandAsync() |         private async Task ExecuteSelectedIndexChangedCommandAsync() | ||||||
|         { |         { | ||||||
|             if (BookmarkCollectionIndex >= 0 && BookmarkCollectionIndex < BookmarkCollectionNames.Count - 1) |             if (Repository.BookmarkCollectionIndex >= 0 && Repository.BookmarkCollectionIndex < Repository.BookmarkCollectionNames.Count - 1) | ||||||
|             { |             { | ||||||
|                 await LoadBookmarkCollectionAsync(BookmarkCollectionNames[BookmarkCollectionIndex]); |                 await LoadBookmarkCollectionAsync(Repository.BookmarkCollectionNames[Repository.BookmarkCollectionIndex]); | ||||||
|             } |             } | ||||||
|             else if (BookmarkCollectionIndex == BookmarkCollectionNames.Count - 1) |             else if (Repository.BookmarkCollectionIndex == Repository.BookmarkCollectionNames.Count - 1) | ||||||
|             { |             { | ||||||
|                 var result = await Main.Navigator.OpenCancellableTextInputAlertDialog(""); |                 var result = await Main.Navigator.OpenCancellableTextInputAlertDialog(""); | ||||||
|                 if (result.Item2 == Navigator.PopupResultEnum.Save) |                 if (result.Item2 == Navigator.PopupResultEnum.Save) | ||||||
|                 { |                 { | ||||||
|                     var index = BookmarkCollectionNames.Count - 1; |                     var index = Repository.BookmarkCollectionNames.Count - 1; | ||||||
|                     BookmarkCollectionNames.Insert(index, result.Item1); |                     Repository.BookmarkCollectionNames.Insert(index, result.Item1); | ||||||
|                     //BookmarkCollectionIndex = index; |                     //BookmarkCollectionIndex = index; | ||||||
|                     BookmarkCollectionIndex = 0; |                     Repository.BookmarkCollectionIndex = 0; | ||||||
|                     await SaveBookmarksAsync(); |                     await SaveBookmarksAsync(); | ||||||
|                 } |                 } | ||||||
|                 else |                 else | ||||||
|                 { |                 { | ||||||
|                     BookmarkCollectionIndex = 0; |                     Repository.BookmarkCollectionIndex = 0; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | @ -121,7 +129,7 @@ namespace AideDeJeu.ViewModels.Library | ||||||
| 
 | 
 | ||||||
|         private async Task ExecuteRemoveItemCommandAsync(Item item) |         private async Task ExecuteRemoveItemCommandAsync(Item item) | ||||||
|         { |         { | ||||||
|             BookmarkCollection.Remove(item); |             Repository.BookmarkCollection.Remove(item); | ||||||
|             await SaveBookmarksAsync(); |             await SaveBookmarksAsync(); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | @ -136,10 +144,10 @@ namespace AideDeJeu.ViewModels.Library | ||||||
| 
 | 
 | ||||||
|         private async Task ExecuteMoveUpItemCommandAsync(Item item) |         private async Task ExecuteMoveUpItemCommandAsync(Item item) | ||||||
|         { |         { | ||||||
|             var index = BookmarkCollection.IndexOf(item); |             var index = Repository.BookmarkCollection.IndexOf(item); | ||||||
|             if (index > 0) |             if (index > 0) | ||||||
|             { |             { | ||||||
|                 BookmarkCollection.Move(index, index - 1); |                 Repository.BookmarkCollection.Move(index, index - 1); | ||||||
|                 await SaveBookmarksAsync(); |                 await SaveBookmarksAsync(); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | @ -155,10 +163,10 @@ namespace AideDeJeu.ViewModels.Library | ||||||
| 
 | 
 | ||||||
|         private async Task ExecuteMoveDownItemCommandAsync(Item item) |         private async Task ExecuteMoveDownItemCommandAsync(Item item) | ||||||
|         { |         { | ||||||
|             var index = BookmarkCollection.IndexOf(item); |             var index = Repository.BookmarkCollection.IndexOf(item); | ||||||
|             if (index < BookmarkCollection.Count - 1) |             if (index < Repository.BookmarkCollection.Count - 1) | ||||||
|             { |             { | ||||||
|                 BookmarkCollection.Move(index, index + 1); |                 Repository.BookmarkCollection.Move(index, index + 1); | ||||||
|                 await SaveBookmarksAsync(); |                 await SaveBookmarksAsync(); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|  | @ -174,27 +182,27 @@ namespace AideDeJeu.ViewModels.Library | ||||||
| 
 | 
 | ||||||
|         private async Task ExecuteConfigureCommandAsync() |         private async Task ExecuteConfigureCommandAsync() | ||||||
|         { |         { | ||||||
|             var result = await Main.Navigator.OpenCancellableTextInputAlertDialog(BookmarkCollectionNames[BookmarkCollectionIndex]); |             var result = await Main.Navigator.OpenCancellableTextInputAlertDialog(Repository.BookmarkCollectionNames[Repository.BookmarkCollectionIndex]); | ||||||
|             if (result.Item2 == Navigator.PopupResultEnum.Delete) |             if (result.Item2 == Navigator.PopupResultEnum.Delete) | ||||||
|             { |             { | ||||||
|                 var confirm = await App.Current.MainPage.DisplayAlert("Supprimer ?", "Etes vous sûr de vouloir supprimer la liste ?", "Supprimer", "Annuler"); |                 var confirm = await App.Current.MainPage.DisplayAlert("Supprimer ?", "Etes vous sûr de vouloir supprimer la liste ?", "Supprimer", "Annuler"); | ||||||
|                 if (confirm) |                 if (confirm) | ||||||
|                 { |                 { | ||||||
|                     var index = BookmarkCollectionIndex; |                     var index = Repository.BookmarkCollectionIndex; | ||||||
|                     var name = BookmarkCollectionNames[BookmarkCollectionIndex]; |                     var name = Repository.BookmarkCollectionNames[Repository.BookmarkCollectionIndex]; | ||||||
|                     await SaveBookmarksAsync(name, null); |                     await SaveBookmarksAsync(name, null); | ||||||
|                     BookmarkCollectionNames.Remove(name); |                     Repository.BookmarkCollectionNames.Remove(name); | ||||||
|                     BookmarkCollectionIndex = 0; |                     Repository.BookmarkCollectionIndex = 0; | ||||||
|                 } |                 } | ||||||
|             } |             } | ||||||
|             else if (result.Item2 == Navigator.PopupResultEnum.Save) |             else if (result.Item2 == Navigator.PopupResultEnum.Save) | ||||||
|             { |             { | ||||||
|                 var index = BookmarkCollectionIndex; |                 var index = Repository.BookmarkCollectionIndex; | ||||||
|                 var items = await GetBookmarkCollectionAsync(BookmarkCollectionNames[index]); |                 var items = await GetBookmarkCollectionAsync(Repository.BookmarkCollectionNames[index]); | ||||||
|                 await SaveBookmarksAsync(BookmarkCollectionNames[index], null); |                 await SaveBookmarksAsync(Repository.BookmarkCollectionNames[index], null); | ||||||
|                 BookmarkCollectionNames[index] = result.Item1; |                 Repository.BookmarkCollectionNames[index] = result.Item1; | ||||||
|                 await SaveBookmarksAsync(BookmarkCollectionNames[index], items); |                 await SaveBookmarksAsync(Repository.BookmarkCollectionNames[index], items); | ||||||
|                 BookmarkCollectionIndex = index; |                 Repository.BookmarkCollectionIndex = index; | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | @ -218,10 +226,10 @@ namespace AideDeJeu.ViewModels.Library | ||||||
|         public async Task LoadBookmarkCollectionAsync(string key) |         public async Task LoadBookmarkCollectionAsync(string key) | ||||||
|         { |         { | ||||||
|             var items = await GetBookmarkCollectionAsync(key); |             var items = await GetBookmarkCollectionAsync(key); | ||||||
|             BookmarkCollection.Clear(); |             Repository.BookmarkCollection.Clear(); | ||||||
|             if (items != null) |             if (items != null) | ||||||
|             { |             { | ||||||
|                 items.ForEach(item => BookmarkCollection.Add(item)); |                 items.ForEach(item => Repository.BookmarkCollection.Add(item)); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | @ -235,13 +243,13 @@ namespace AideDeJeu.ViewModels.Library | ||||||
|             } |             } | ||||||
|             items.Add(linkItem); |             items.Add(linkItem); | ||||||
|             await SaveBookmarksAsync(key, items); |             await SaveBookmarksAsync(key, items); | ||||||
|             BookmarkCollectionIndex = BookmarkCollectionNames.IndexOf(key); |             Repository.BookmarkCollectionIndex = Repository.BookmarkCollectionNames.IndexOf(key); | ||||||
|             await LoadBookmarkCollectionAsync(key); |             await LoadBookmarkCollectionAsync(key); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|         public async Task SaveBookmarksAsync() |         public async Task SaveBookmarksAsync() | ||||||
|         { |         { | ||||||
|             App.Current.Properties[BookmarkCollectionNames[BookmarkCollectionIndex]] = ToString(BookmarkCollection); |             App.Current.Properties[Repository.BookmarkCollectionNames[Repository.BookmarkCollectionIndex]] = ToString(Repository.BookmarkCollection); | ||||||
|             await App.Current.SavePropertiesAsync(); |             await App.Current.SavePropertiesAsync(); | ||||||
|         } |         } | ||||||
| 
 | 
 | ||||||
|  | @ -261,7 +269,7 @@ namespace AideDeJeu.ViewModels.Library | ||||||
| 
 | 
 | ||||||
|         public async Task InitBookmarkCollectionsAsync() |         public async Task InitBookmarkCollectionsAsync() | ||||||
|         { |         { | ||||||
|             _BookmarkCollections = new Dictionary<string, ObservableCollection<Item>>() |             Repository._BookmarkCollections = new Dictionary<string, ObservableCollection<Item>>() | ||||||
|             { |             { | ||||||
|                 { "Général", new ObservableCollection<Item>() }, |                 { "Général", new ObservableCollection<Item>() }, | ||||||
|                 { "Grimoire", new ObservableCollection<Item>() }, |                 { "Grimoire", new ObservableCollection<Item>() }, | ||||||
|  | @ -278,14 +286,14 @@ namespace AideDeJeu.ViewModels.Library | ||||||
|                 { |                 { | ||||||
|                     var spells = context.Spells.ToList(); |                     var spells = context.Spells.ToList(); | ||||||
|                     var spell = spells.Take(1).FirstOrDefault(); |                     var spell = spells.Take(1).FirstOrDefault(); | ||||||
|                     _BookmarkCollections["Grimoire"].Add(new Item() { Id = spell.Id, Name = spell.Name }); |                     Repository._BookmarkCollections["Grimoire"].Add(new Item() { Id = spell.Id, Name = spell.Name }); | ||||||
|                 } |                 } | ||||||
|                 await SaveBookmarkCollectionsAsync(); |                 await SaveBookmarkCollectionsAsync(); | ||||||
|             } |             } | ||||||
|         } |         } | ||||||
|         public async Task SaveBookmarkCollectionsAsync() |         public async Task SaveBookmarkCollectionsAsync() | ||||||
|         { |         { | ||||||
|             var yaml = new YamlDotNet.Serialization.Serializer().Serialize(_BookmarkCollections); |             var yaml = new YamlDotNet.Serialization.Serializer().Serialize(Repository._BookmarkCollections); | ||||||
|             Debug.WriteLine(yaml); |             Debug.WriteLine(yaml); | ||||||
|         } |         } | ||||||
|         public string ToString(IEnumerable<Item> items) |         public string ToString(IEnumerable<Item> items) | ||||||
|  |  | ||||||
|  | @ -183,14 +183,15 @@ namespace AideDeJeu.ViewModels | ||||||
| 
 | 
 | ||||||
|             //await Application.Current.MainPage.DisplayAlert("Id", item.Id, "OK"); |             //await Application.Current.MainPage.DisplayAlert("Id", item.Id, "OK"); | ||||||
|             var item = itemVM.Item; |             var item = itemVM.Item; | ||||||
|             var vm = Main.Bookmarks; |             var repo = Main.Bookmarks; | ||||||
|             var result = await Application.Current.MainPage.DisplayActionSheet("Ajouter à", "Annuler", "Nouvelle liste", vm.BookmarkCollectionNames.ToArray<string>()); |             var vm = new BookmarksViewModel();  | ||||||
|  |             var result = await Application.Current.MainPage.DisplayActionSheet("Ajouter à", "Annuler", "Nouvelle liste", repo.BookmarkCollectionNames.ToArray<string>()); | ||||||
|             if (result != "Annuler") |             if (result != "Annuler") | ||||||
|             { |             { | ||||||
|                 if (result == "Nouvelle liste") |                 if (result == "Nouvelle liste") | ||||||
|                 { |                 { | ||||||
|                     int i = 1; |                     int i = 1; | ||||||
|                     while (vm.BookmarkCollectionNames.Contains(result = $"Nouvelle liste ({i})")) |                     while (repo.BookmarkCollectionNames.Contains(result = $"Nouvelle liste ({i})")) | ||||||
|                     { |                     { | ||||||
|                         i++; |                         i++; | ||||||
|                     } |                     } | ||||||
|  |  | ||||||
|  | @ -34,17 +34,17 @@ | ||||||
|                 <RowDefinition Height="*" /> |                 <RowDefinition Height="*" /> | ||||||
|             </Grid.RowDefinitions> |             </Grid.RowDefinitions> | ||||||
| 
 | 
 | ||||||
|             <Picker x:Name="BookmarkCollectionPicker" Grid.Column="0" Grid.Row="0" HorizontalOptions="Fill" ItemsSource="{Binding BookmarkCollectionNames, Mode=OneWay}" ItemDisplayBinding="{Binding Mode=OneWay}" SelectedIndex="{Binding BookmarkCollectionIndex, Mode=TwoWay}"> |             <Picker x:Name="BookmarkCollectionPicker" Grid.Column="0" Grid.Row="0" HorizontalOptions="Fill" ItemsSource="{Binding Repository.BookmarkCollectionNames, Mode=OneWay}" ItemDisplayBinding="{Binding Mode=OneWay}" SelectedIndex="{Binding Repository.BookmarkCollectionIndex, Mode=TwoWay}"> | ||||||
|               <!--Style="{StaticResource heading1}"--> |               <!--Style="{StaticResource heading1}"--> | ||||||
|               <Picker.Behaviors> |               <Picker.Behaviors> | ||||||
|                     <tools:EventToCommandBehavior EventName="SelectedIndexChanged" Command="{Binding BindingContext.SelectedIndexChangedCommand, Source={x:Reference This}}" /> |                     <tools:EventToCommandBehavior EventName="SelectedIndexChanged" Command="{Binding BindingContext.SelectedIndexChangedCommand, Source={x:Reference This}}" /> | ||||||
|                 </Picker.Behaviors> |                 </Picker.Behaviors> | ||||||
|             </Picker> |             </Picker> | ||||||
| 
 | 
 | ||||||
|             <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" HorizontalOptions="Center" VerticalOptions="Center" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Margin="15,0,15,0" Style="{StaticResource heading3}" Text="Cette liste est vide, ajoutez des éléments à partir de la bibliothèque !" IsVisible="{Binding BookmarkCollection.Count, Converter={StaticResource IntToBooleanConverter}}" /> |             <Label Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" HorizontalOptions="Center" VerticalOptions="Center" HorizontalTextAlignment="Center" VerticalTextAlignment="Center" Margin="15,0,15,0" Style="{StaticResource heading3}" Text="Cette liste est vide, ajoutez des éléments à partir de la bibliothèque !" IsVisible="{Binding Repository.BookmarkCollection.Count, Converter={StaticResource IntToBooleanConverter}}" /> | ||||||
| 
 | 
 | ||||||
|             <!--SelectedItem="{Binding SelectedItem}"--> |             <!--SelectedItem="{Binding SelectedItem}"--> | ||||||
|             <ListView Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" x:Name="ItemsListView" SelectionMode="None" ItemsSource="{Binding BookmarkCollection}" VerticalOptions="FillAndExpand" HasUnevenRows="true" CachingStrategy="RecycleElement"> |             <ListView Grid.Column="0" Grid.Row="1" Grid.ColumnSpan="2" x:Name="ItemsListView" SelectionMode="None" ItemsSource="{Binding Repository.BookmarkCollection}" VerticalOptions="FillAndExpand" HasUnevenRows="true" CachingStrategy="RecycleElement"> | ||||||
|                 <ListView.ItemTemplate> |                 <ListView.ItemTemplate> | ||||||
|                     <DataTemplate x:DataType="lib:Item"> |                     <DataTemplate x:DataType="lib:Item"> | ||||||
|                         <ViewCell> |                         <ViewCell> | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Yan Maniez
						Yan Maniez