1
0
Fork 0
mirror of https://github.com/Nioux/AideDeJeu.git synced 2025-10-29 14:35:45 +00:00

Correctif rapide bookmarks en attendant refonte

This commit is contained in:
Yan Maniez 2019-10-28 22:08:13 +01:00
parent 1bc5b614c0
commit 1ea384afaf

View file

@ -243,14 +243,25 @@ namespace AideDeJeu.ViewModels.Library
}
items.Add(linkItem);
await SaveBookmarksAsync(key, items);
Repository.BookmarkCollectionIndex = Repository.BookmarkCollectionNames.IndexOf(key);
if (Repository.BookmarkCollectionNames.IndexOf(key) >= 0)
{
Repository.BookmarkCollectionIndex = Repository.BookmarkCollectionNames.IndexOf(key);
}
else
{
Repository.BookmarkCollectionNames.Insert(Repository.BookmarkCollectionNames.Count - 1, key);
Repository.BookmarkCollectionIndex = Repository.BookmarkCollectionNames.IndexOf(key);
}
await LoadBookmarkCollectionAsync(key);
}
public async Task SaveBookmarksAsync()
{
App.Current.Properties[Repository.BookmarkCollectionNames[Repository.BookmarkCollectionIndex]] = ToString(Repository.BookmarkCollection);
await App.Current.SavePropertiesAsync();
if (Repository.BookmarkCollectionIndex >= 0)
{
App.Current.Properties[Repository.BookmarkCollectionNames[Repository.BookmarkCollectionIndex]] = ToString(Repository.BookmarkCollection);
await App.Current.SavePropertiesAsync();
}
}
public async Task SaveBookmarksAsync(string key, List<Item> items)