public RecipeEditViewModel(INavigation nav)
        {
            _nav      = nav;
            _recipeId = Guid.NewGuid();

            _dataSvc = new RecipeDataService();
        }
        public RecipeListViewModel(INavigation nav)
        {
            _nav     = nav;
            _dataSvc = new RecipeDataService();

            AllRecipes = new ObservableCollection <Recipe>();

            MessagingCenter.Subscribe <RecipeEditViewModel>(this, RecipeSavedMessage, (obj) => RefreshRecipes());
        }
        public RecipeEditViewModel(Guid recipeId, INavigation nav)
        {
            _recipeId = recipeId;
            _nav      = nav;

            _dataSvc = new RecipeDataService();

            var recipe = _dataSvc.GetSingleRecipe(recipeId);

            RecipeName = recipe.RecipeName;
            CookTime   = recipe.CookTime;
            MakeAgain  = recipe.MakeAgain;
        }
Beispiel #4
0
        void LoadRecipeInformation()
        {
            var svc = new RecipeDataService();

            _theRecipe = svc.GetSingleRecipe(RecipeId);
        }
Beispiel #5
0
        public RecipeListViewModel()
        {
            _dataSvc = new RecipeDataService();

            AllRecipes = new ObservableCollection <Recipe>();
        }