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

            SaveFavourites();

            NoFavouritesVisibility = Visibility.Collapsed;
        }
예제 #2
0
        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);
        }
예제 #3
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;
            }
        }