public void AddFavourite(PodViewModel model) { FavouritePods.Add(model); SaveFavourites(); NoFavouritesVisibility = Visibility.Collapsed; }
private void AddPod(int strength, string name, string groupName, string uri, bool isDecaf, Color backgroundColour, CupSizeEnum cupSizes, string description) { var newModel = new PodViewModel() { Name = name, Strength = strength, GroupName = groupName, ListImageUri = new Uri("/Images/Small/" + uri, UriKind.Relative), DetailImageUri = new Uri("/Images/Large/" + uri, UriKind.Relative), IsDecaf = isDecaf, Description = description, BackgroundColour = backgroundColour, CupSizes = cupSizes }; Pods.Add(newModel); }
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; } }