Beispiel #1
0
        public void AddFavourite(PodViewModel model)
        {
            FavouritePods.Add(model);

            SaveFavourites();

            NoFavouritesVisibility = Visibility.Collapsed;
        }
Beispiel #2
0
        public void RemoveFavourite(PodViewModel model)
        {
            var removingModel = FavouritePods.FirstOrDefault(x => x.Name == model.Name);

            if (removingModel == null)
            {
                return;
            }

            FavouritePods.Remove(removingModel);

            SaveFavourites();

            if (!FavouritePods.Any())
            {
                NoFavouritesVisibility = Visibility.Visible;
            }
        }
Beispiel #3
0
 private void SaveFavourites()
 {
     IsolatedStorageSettings.ApplicationSettings["Favourites"] = FavouritePods.Select(x => x.Name).ToList();
 }