Index: Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Views/WaveConditionsInputView.cs =================================================================== diff -u -r5d517d1330fbcd67b88a1f23d01e006e1ad98c1c -rc9718aac47d13f790a2ec0cc7d51305361b90d77 --- Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Views/WaveConditionsInputView.cs (.../WaveConditionsInputView.cs) (revision 5d517d1330fbcd67b88a1f23d01e006e1ad98c1c) +++ Ringtoets/Revetment/src/Ringtoets.Revetment.Forms/Views/WaveConditionsInputView.cs (.../WaveConditionsInputView.cs) (revision c9718aac47d13f790a2ec0cc7d51305361b90d77) @@ -22,6 +22,7 @@ using System; using System.Windows.Forms; using Core.Common.Base; +using Core.Common.Base.Data; using Core.Common.Util.Extensions; using Core.Components.Chart.Data; using Core.Components.Chart.Forms; @@ -38,6 +39,8 @@ /// public partial class WaveConditionsInputView : UserControl, IChartView { + private readonly Func getNormativeAssessmentLevelFunc; + private readonly Observer calculationObserver; private readonly Observer calculationInputObserver; private readonly Observer hydraulicBoundaryLocationObserver; @@ -59,17 +62,25 @@ /// Creates a new instance of . /// /// The style which should be applied to the . - /// Thrown when - /// is null. - public WaveConditionsInputView(IWaveConditionsInputViewStyle inputViewStyle) + /// for obtaining the normative assessment level. + /// Thrown when any input parameter is null. + public WaveConditionsInputView(IWaveConditionsInputViewStyle inputViewStyle, + Func getNormativeAssessmentLevelFunc) { if (inputViewStyle == null) { throw new ArgumentNullException(nameof(inputViewStyle)); } + if (getNormativeAssessmentLevelFunc == null) + { + throw new ArgumentNullException(nameof(getNormativeAssessmentLevelFunc)); + } + InitializeComponent(); + this.getNormativeAssessmentLevelFunc = getNormativeAssessmentLevelFunc; + calculationObserver = new Observer(UpdateChartTitle); calculationInputObserver = new Observer(UpdateCalculationInput); hydraulicBoundaryLocationObserver = new Observer(UpdateChartData); @@ -143,6 +154,7 @@ { components?.Dispose(); } + base.Dispose(disposing); } @@ -176,7 +188,7 @@ lowerBoundaryWaterLevelsChartData.Points = WaveConditionsChartDataPointsFactory.CreateLowerBoundaryWaterLevelsGeometryPoints(input); upperBoundaryWaterLevelsChartData.Points = WaveConditionsChartDataPointsFactory.CreateUpperBoundaryWaterLevelsGeometryPoints(input); designWaterLevelChartData.Points = WaveConditionsChartDataPointsFactory.CreateDesignWaterLevelGeometryPoints(input); - waterLevelsChartData.Lines = WaveConditionsChartDataPointsFactory.CreateWaterLevelsGeometryPoints(input, input.AssessmentLevel); + waterLevelsChartData.Lines = WaveConditionsChartDataPointsFactory.CreateWaterLevelsGeometryPoints(input, getNormativeAssessmentLevelFunc()); revetmentBaseChartData.Points = WaveConditionsChartDataPointsFactory.CreateRevetmentBaseGeometryPoints(input); revetmentChartData.Points = WaveConditionsChartDataPointsFactory.CreateRevetmentGeometryPoints(input); }