internal static void CreateNewRecipe(RecipeViewModel recipe) { var recipeModel = new RecipeModel() { Name = recipe.RecipeName, Products = string.Join(", ", recipe.Products), CookingSteps = recipe.CookingSteps, ImagePath = recipe.ImagePath }; var headers = new Dictionary<string, string>(); headers["X-accessToken"] = AccessToken; var response = HttpRequester.PostAsync<RecipeCreatedModel>(BaseServicesUrl + "recipe/new", recipeModel, headers); }
private async void HandleNavigateToRecipeCommand(object obj) { if (SelectedRecipe == null) { return; } var newVM = new RecipeViewModel() { RecipeName = this.SelectedRecipe.Name, Products = this.SelectedRecipe.Products, CookingSteps = this.SelectedRecipe.CookingSteps, ImagePath = this.SelectedRecipe.ImagePath, Comments = new CommentsListViewModel(){ CommentsList = await DataPersister.GetCommentsAsync(this.SelectedRecipe.Id), RecipeId = this.SelectedRecipe.Id } }; this.RaiseRecipeNavigate(newVM); }
protected void RaiseRecipeNavigate(RecipeViewModel vm) { if (this.RecipeNavigate != null) { this.RecipeNavigate(this, new RecipeNavigateArgs(vm)); } }