示例#1
0
 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();
        }
示例#3
0
        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);
            });
        }
示例#4
0
        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);
            });
        }
示例#6
0
 public FavoritesBeerInfoPageViewModel(INavigationService navigation, IApiBeerService apiService, IPageDialogService pageDialogService) : base(navigation, apiService, pageDialogService)
 {
 }
示例#7
0
 public BaseViewModel(INavigationService navigationService, IApiBeerService apiService, IPageDialogService pageDialogService)
 {
     NavigationService = navigationService;
     ApiService        = apiService;
     PageDialogService = pageDialogService;
 }