Exemple #1
0
 public MyFavoritesPageViewModel(PageDialogService pageDialogService, INavigationService navigationService, ICocktailsManager cocktailsManager) : base(pageDialogService, navigationService)
 {
     this.cocktailsManager      = cocktailsManager;
     IsActiveChanged           += new EventHandler(OnActivated);
     RemoveFromFavoritesCommand = new DelegateCommand <Cocktail>(async(param) => { await RemoveFromFavorites(param); });
     GoToDrinkCommand           = new DelegateCommand <string>(async(param) => { await GoToDrink(param); });
 }
 public CocktailDetailsPageViewModel(PageDialogService pageDialogService, INavigationService navigationService, ICocktailsManager cocktailsManager) : base(pageDialogService, navigationService)
 {
     _cocktailsManager     = cocktailsManager;
     ShareCocktailCommand  = new DelegateCommand(async() => { await ShareCocktail(); });
     MarkAsFavoriteCommand = new DelegateCommand(async() => { await ToggleFavorite(); });
     GoToIngredientCommand = new DelegateCommand <string>(async(param) => { await GoToIngredient(param); });
 }
Exemple #3
0
        public CocktailsListPageViewModel(PageDialogService pageDialogService, INavigationService navigationService, ICategoriesManager categoriesManager, IGlassesManager glassesManager, IIngredientsManager ingredientsManager, ICocktailsManager cocktailsManager) : base(pageDialogService, navigationService)
        {
            this.categoriesManager  = categoriesManager;
            this.glassesManager     = glassesManager;
            this.ingredientsManager = ingredientsManager;
            this.cocktailsManager   = cocktailsManager;

            ToggleFavoriteCommand = new DelegateCommand <Cocktail>(async(param) => { await ToggleFavorite(param); });
            GoToDrinkCommand      = new DelegateCommand <string>(async(param) => { await GoToDrink(param); });
        }
 public SurpriseMePageViewModel(PageDialogService pageDialogService, INavigationService navigationService, ICocktailsManager cocktailsManager, IIngredientsManager ingredientsManager, IGlassesManager glassesManager) : base(pageDialogService, navigationService)
 {
     this.cocktailsManager           = cocktailsManager;
     this.glassesManager             = glassesManager;
     this.ingredientsManager         = ingredientsManager;
     typeAssistant                   = new TypeAssistant(500);
     typeAssistant.OnFinishedTyping += OnSearch;
     IsFiltered = false;
     GoToAlcoholicDrinkCommand    = new DelegateCommand <ImageOption>(async(param) => { await GoToAlcoholicDrink(); });
     GoToNonAlcoholicDrinkCommand = new DelegateCommand <ImageOption>(async(param) => { await GoToNonAlcoholicDrink(); });
     SearchCommand      = new DelegateCommand(SearchTermChanged);
     RefreshDataCommand = new DelegateCommand(async() => { await GetData(); });
     GoToDrinkCommand   = new DelegateCommand <string>(async(param) => { await GoToDrink(param); });
     GoToCocktailWithIngredientCommand = new DelegateCommand(async() => { await GoToCocktailWithIngredient(); });
     GoToCocktailWithGlassCommand      = new DelegateCommand(async() => { await GoToCocktailWithGlass(); });
     ClearSearchCommand = new DelegateCommand(() => SearchTerm = string.Empty);
     IsActiveChanged   += new EventHandler(OnActivated);
     RefreshDataCommand.Execute();
 }
 public IngredientDetailsPageViewModel(PageDialogService pageDialogService, INavigationService navigationService, ICocktailsManager cocktailsManager, IIngredientsManager ingredientsManager) : base(pageDialogService, navigationService)
 {
     _cocktailsManager   = cocktailsManager;
     _ingredientsManager = ingredientsManager;
     GoToDrinksCommand   = new DelegateCommand <string>(async(param) => { await GoToDrinksByIngredient(param); });
 }