Index: Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextProperties.cs =================================================================== diff -u -r5b7a6432b888a0d8cfa74bf9ee81c90ad534b76e -r9a001397536d9dcca5d009c8518478cdfcddbeca --- Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextProperties.cs (.../GrassCoverErosionInwardsFailureMechanismContextProperties.cs) (revision 5b7a6432b888a0d8cfa74bf9ee81c90ad534b76e) +++ Ringtoets/GrassCoverErosionInwards/src/Ringtoets.GrassCoverErosionInwards.Forms/PropertyClasses/GrassCoverErosionInwardsFailureMechanismContextProperties.cs (.../GrassCoverErosionInwardsFailureMechanismContextProperties.cs) (revision 9a001397536d9dcca5d009c8518478cdfcddbeca) @@ -20,6 +20,7 @@ // All rights reserved. using System.ComponentModel; +using Core.Common.Base; using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; @@ -35,6 +36,7 @@ /// public class GrassCoverErosionInwardsFailureMechanismContextProperties : ObjectProperties { + private readonly IFailureMechanismPropertyChangeHandler propertyChangeHandler; private const int namePropertyIndex = 1; private const int codePropertyIndex = 2; private const int lengthEffectPropertyIndex = 3; @@ -43,6 +45,19 @@ private const int fnFactorPropertyIndex = 6; private const int fshallowModelFactorPropertyIndex = 7; + /// + /// Creates a new instance of . + /// + /// The instance to show the properties of. + /// Handler responsible for handling effects of a property change. + public GrassCoverErosionInwardsFailureMechanismContextProperties( + GrassCoverErosionInwardsFailureMechanismContext data, + IFailureMechanismPropertyChangeHandler propertyChangeHandler) + { + Data = data; + this.propertyChangeHandler = propertyChangeHandler; + } + #region Length effect parameters [PropertyOrder(lengthEffectPropertyIndex)] @@ -57,8 +72,18 @@ } set { - data.WrappedData.GeneralInput.N = value; - data.WrappedData.NotifyObservers(); + + if (propertyChangeHandler.ConfirmPropertyChange()) + { + data.WrappedData.GeneralInput.N = value; + + var changedObjects = propertyChangeHandler.PropertyChanged(data.WrappedData); + foreach (IObservable changedObject in changedObjects) + { + changedObject.NotifyObservers(); + } + data.WrappedData.NotifyObservers(); + } } }