Ejemplo n.º 1
0
        private async Task ExecuteFavoriteCommandAsync(WorkshopCellViewViewModel workshop)
        {
            var toggled = await FavoriteService.ToggleFavorite(workshop.SelectedWorkshop);

            if (toggled && Settings.FavoritesOnly)
            {
                SortWorkshops();
            }
        }
Ejemplo n.º 2
0
        private async Task ExecuteFavoriteWorkshopCommand(WorkshopCellViewViewModel workshop)
        {
            if (workshop?.SelectedWorkshop == null)
            {
                return;
            }

            var response = await PageDialogService.DisplayAlertAsync("Unfavorite workshop",
                                                                     "Are you sure you want to remove this workshop from your favorites?",
                                                                     "Unfavorite",
                                                                     "Cancel");

            if (response)
            {
                var toggled = await FavoriteService.ToggleFavorite(workshop.SelectedWorkshop);

                if (toggled)
                {
                    await ExecuteLoadWorkshopsCommandAsync();
                }
            }
        }