/// <summary> /// Update the favorite icon of a quote /// </summary> /// <param name="key"></param> public static void SyncFavorites(string key) { if (SearchCollection.Contains(key)) { Quote quote = SearchCollection[key]; quote.IsFavorite = FavoritesController.IsFavorite(key); } }
/* * ******** * METHODS * ******** */ /// <summary> /// Load today quotes and the favorites collection /// </summary> /// <returns>True if the data has been loaded</returns> public async Task <bool> LoadData() { await FavoritesController.Initialize(); if (IsDataLoaded()) { return(true); } int added = await FetchAndRecover(); Quote lockscreenQuote = GetLockScreenQuote(); if (lockscreenQuote != null) { TodayCollection.Insert(0, lockscreenQuote); } if (added > 0) { return(true); } return(false); }
/// <summary> /// Initialize the favorite quotes collection from the FavoritesController /// </summary> /// <returns></returns> public async Task <bool> InitalizeFavorites() { return(await FavoritesController.Initialize()); }