/// <summary> /// RecipeStepPage Constructor /// </summary> /// /// <param name="item"></param> /// <param name="PageNumber"></param> /// <param name="TotalPages"></param> /// ///<remarks> /// Takes In a Recipe Object, and Two Integers representing the Current Step Number and the Total amount of steps /// </remarks> public RecipeStepPage(Recipe item, int PageNumber, int TotalPages) { InitializeComponent(); CurrentPageNumber = PageNumber; TotalPageCount = TotalPages; Item = item; InstructionText.Text = Item.RecipeSteps[CurrentPageNumber - 1].InstructionText; StepTitle.Text = Item.RecipeSteps[CurrentPageNumber - 1].Title; BindingContext = viewModel = new RecipeStepViewModel(CurrentPageNumber, TotalPageCount, Item); CurrentSeconds = Item.RecipeSteps[CurrentPageNumber - 1].TimerSecondCount; CurrentMinutes = Item.RecipeSteps[CurrentPageNumber - 1].TimerMinuteCount; LoadRecipeImage(); if (CurrentPageNumber == TotalPageCount) { NextStep.Text = "Finish"; } //Enable Timer if Applicable to Recipe Step if (Item.RecipeSteps[CurrentPageNumber - 1].HasTimer) { TimerBlock.IsVisible = true; TimerText.Text = Item.RecipeSteps[CurrentPageNumber - 1].TimerMinuteCount.ToString().PadLeft(2, '0') + ":" + Item.RecipeSteps[CurrentPageNumber - 1].TimerSecondCount.ToString().PadLeft(2, '0'); } }
/// <summary> /// /// </summary> public RecipeStepPage() { CurrentPageNumber = 0; TotalPageCount = 0; InitializeComponent(); BindingContext = viewModel = new RecipeStepViewModel(CurrentPageNumber, TotalPageCount, null); }
public IActionResult AddRecipeStep([FromQuery(Name = "itemName")] string itemName) { if (itemName == null) { return(this.Redirect("/")); } var recipeStepViewModel = new RecipeStepViewModel { ItemName = itemName }; return(this.View(recipeStepViewModel)); }