private void AddOtherIngredientsButton_Click(object sender, RoutedEventArgs e) { var w = new AddOtherIngredients(); w.ShowDialog(); if (w.Result != null) { OtherIngredientsList.Add(w.Result); } }
private void PopulateGUI(Recepie aRecepie) { Grist.Clear(); foreach (GristPart g in aRecepie.Fermentables) { Grist.Add(g); } BoilHops.Clear(); foreach (HopAddition h in aRecepie.BoilHops) { BoilHops.Add(h); } MashProfileList.Clear(); foreach (Domain.MashProfileStep mps in aRecepie.MashProfile) { MashProfileList.Add(mps); } OtherIngredientsList.Clear(); foreach (OtherIngredient o in aRecepie.OtherIngredients) { OtherIngredientsList.Add(o); } Volumes.FinalBatchVolume = aRecepie.BatchVolume; BatchSizeVolumeTextBox.Text = Volumes.FinalBatchVolume.ToString(); Volumes.PreBoilTapOff = aRecepie.PreBoilTapOffVolume; PreBoilVolumeTextBox.Text = Volumes.PreBoilTapOff.ToString(); TopUpMashWater = aRecepie.TopUpMashWater; TopUpMashWaterVolumeTextBox.Text = TopUpMashWater.ToString(); OriginalGravity = aRecepie.OriginalGravity; ExpectedOriginalGravityTextBox.Text = OriginalGravity.ToString(); BoilTime = aRecepie.BoilTime; BoilTimeTextBox.Text = BoilTime.ToString(); NameTextBox.Text = aRecepie.Name; recalculateGrainBill(); recalculateIbu(); updateGuiText(); }