void ShowPopup(FavoriteViewModel vm) { if (null == vm) return; var popup = new UIAlertView(View.Frame); popup.Title = vm.Name; popup.AddButton("Fjern fra favoritter"); popup.AddButton("Vis detaljer"); popup.AddButton("Avbryt"); popup.CancelButtonIndex = 2; popup.Dismissed += (sender, e) => { switch(e.ButtonIndex) { case 0 : ViewModel.RemoveFavorite(vm.DocumentNumber, vm); break; case 1: ViewModel.ShowDetailsCommand.Execute(vm); break; } }; popup.Show(); }
public async void RemoveFavorite(string documentNumber, FavoriteViewModel favorite) { Favorites.Remove(favorite); FavoriteIsRemoved = true; await _service.RemoveUserFavorite(documentNumber); Analytics.LogEvent("Media_UnFavorite", new Dictionary<string, string> { { "title", favorite.Title } }); }
public void AddFavorite(FavoriteViewModel favoriteViewModel) { Favorites.Add(favoriteViewModel); }
private void ExecuteShowDetailsCommand(FavoriteViewModel model) { if (model.DocumentNumber != "") { ShowViewModel<MediaDetailViewModel>(new { title = model.Name, docId = model.DocumentNumber }); } }