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

            SaveFavourites();

            NoFavouritesVisibility = Visibility.Collapsed;
        }
示例#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;
            }
        }
示例#3
0
 private void SaveFavourites()
 {
     IsolatedStorageSettings.ApplicationSettings["Favourites"] = FavouritePods.Select(x => x.Name).ToList();
 }