public void AddFavourite(PodViewModel model) { FavouritePods.Add(model); SaveFavourites(); NoFavouritesVisibility = Visibility.Collapsed; }
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; } }
private void SaveFavourites() { IsolatedStorageSettings.ApplicationSettings["Favourites"] = FavouritePods.Select(x => x.Name).ToList(); }