コード例 #1
0
 private async Task LoadFavStations()
 {
     await DispatcherHelper.UIDispatcher.RunAsync(CoreDispatcherPriority.Normal, () =>
     {
         FavChannels.Clear();
         var items = _dataService.LoadFavStations();
         foreach (var item in items)
         {
             FavChannels.Add(item);
         }
         if (FavChannels.Count > 0)
         {
             AreFavoritesPresent = true;
         }
         else
         {
             AreFavoritesPresent = false;
         }
     });
 }
コード例 #2
0
 private void AddToFavStations()
 {
     if (SelectedChannel != null)
     {
         SelectedChannel.IsFav = true;
         FavChannels.Clear();
         var items = _dataService.AddToFavChannels(SelectedChannel);
         foreach (var item in items)
         {
             FavChannels.Add(item);
         }
         if (FavChannels.Count > 0)
         {
             AreFavoritesPresent = true;
         }
         else
         {
             AreFavoritesPresent = false;
         }
     }
 }