public MainAppPageViewModel(INavigationService navigation, IApiBeerService apiService, IPageDialogService pageDialogService) : base(navigation, apiService, pageDialogService) { TabNavigacion = new DelegateCommand(async() => { var request = new AuthenticationRequestConfiguration("Use your fingerprint, We need to verify your humanity!"); var result = await CrossFingerprint.Current.AuthenticateAsync(request); if (result.Authenticated) { await NavigationService.NavigateAsync(NavigationConstants.TabbedMenu); } else { await pageDialogService.DisplayAlertAsync("Results are here", "Invalid fingerprint", "Ok"); } }); }
public BeerInfoPageViewModel(INavigationService navigation, IApiBeerService apiService, IPageDialogService pageDialogService) : base(navigation, apiService, pageDialogService) { FavoriteList = new ObservableCollection <Datum>(); FavoriteIcon = "favoritesIcon.png"; AddToFavoritesCommand = new DelegateCommand(async() => { await AddToFavorites(NewBeer); }); GetBeerInformation = new DelegateCommand(async() => { await GetBeerInfo(); }); GetBeerInformation.Execute(); }
public HomePageViewModel(INavigationService navigation, IApiBeerService apiService, IPageDialogService pageDialogService) : base(navigation, apiService, pageDialogService) { GetBeerList = new DelegateCommand(async() => { await GetBeers(); }); GetBeerList.Execute(); GoToInfoBeerPage = new DelegateCommand <Datum>(async(param) => { var nav = new NavigationParameters(); nav.Add("Beer", param); await NavigationService.NavigateAsync(NavigationConstants.BeerInfoPage, nav); }); }
public RandomBeerPageViewModel(INavigationService navigation, IApiBeerService apiService, IPageDialogService pageDialogService) : base(navigation, apiService, pageDialogService) { IsBusy = true; GetRandomBeer = new DelegateCommand(async() => { await GetBeerData(); }); GetRandomBeer.Execute(); GoToRandomBeerDetailedPage = new DelegateCommand(async() => { await navigation.NavigateAsync(NavigationConstants.RandomBeerDetailedPage); }); GoBackCommand = new DelegateCommand(async() => { await navigation.GoBackAsync(); }); }
public FavoritesListInfoPageViewModel(INavigationService navigationService, IApiBeerService apiService, IPageDialogService pageDialogService) : base(navigationService, apiService, pageDialogService) { GetBeersCommand = new DelegateCommand(async() => { await GetBeersData(); }); GetBeersCommand.Execute(); RefreshCommand = new DelegateCommand(async() => { IsRefreshing = true; Data.Clear(); await GetBeersData(); IsRefreshing = false; }); ActionSheetCommand = new DelegateCommand <Beer>((param) => { ActionSheertMethod(param); }); }
public FavoritesBeerInfoPageViewModel(INavigationService navigation, IApiBeerService apiService, IPageDialogService pageDialogService) : base(navigation, apiService, pageDialogService) { }
public BaseViewModel(INavigationService navigationService, IApiBeerService apiService, IPageDialogService pageDialogService) { NavigationService = navigationService; ApiService = apiService; PageDialogService = pageDialogService; }