Index: Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingFailureMechanismContextProperties.cs =================================================================== diff -u -rc3a85c5842b82e538c80029f35ae3e7e58aadb1e -rf423289729b381361eed8bb5eacc7596a710d78a --- Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingFailureMechanismContextProperties.cs (.../PipingFailureMechanismContextProperties.cs) (revision c3a85c5842b82e538c80029f35ae3e7e58aadb1e) +++ Ringtoets/Piping/src/Ringtoets.Piping.Forms/PropertyClasses/PipingFailureMechanismContextProperties.cs (.../PipingFailureMechanismContextProperties.cs) (revision f423289729b381361eed8bb5eacc7596a710d78a) @@ -19,10 +19,13 @@ // Stichting Deltares and remain full property of Stichting Deltares at all times. // All rights reserved. +using System; +using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; using Core.Common.Utils.Attributes; +using Ringtoets.Common.Forms.PropertyClasses; using Ringtoets.Piping.Forms.PresentationObjects; using Ringtoets.Piping.Forms.Properties; using RingtoetsCommonFormsResources = Ringtoets.Common.Forms.Properties.Resources; @@ -34,6 +37,29 @@ /// public class PipingFailureMechanismContextProperties : ObjectProperties { + private readonly IFailureMechanismPropertyChangeHandler propertyChangeHandler; + + /// + /// Creates a new instance of . + /// + /// The instance to show the properties of. + /// Handler responsible for handling effects of a property change. + public PipingFailureMechanismContextProperties( + PipingFailureMechanismContext data, + IFailureMechanismPropertyChangeHandler handler) + { + if (data == null) + { + throw new ArgumentNullException("data"); + } + if (handler == null) + { + throw new ArgumentNullException("handler"); + } + Data = data; + propertyChangeHandler = handler; + } + #region Heave [PropertyOrder(31)] @@ -88,8 +114,11 @@ } set { - data.WrappedData.GeneralInput.WaterVolumetricWeight = value; - data.WrappedData.NotifyObservers(); + if (propertyChangeHandler.ConfirmPropertyChange()) + { + data.WrappedData.GeneralInput.WaterVolumetricWeight = value; + OnPropertyChanged(); + } } } @@ -137,8 +166,11 @@ } set { - data.WrappedData.PipingProbabilityAssessmentInput.A = value; - data.WrappedData.NotifyObservers(); + if (propertyChangeHandler.ConfirmPropertyChange()) + { + data.WrappedData.PipingProbabilityAssessmentInput.A = value; + OnPropertyChanged(); + } } } @@ -243,5 +275,15 @@ } #endregion + + private void OnPropertyChanged() + { + var changedObjects = propertyChangeHandler.PropertyChanged(data.WrappedData); + foreach (IObservable changedObject in changedObjects) + { + changedObject.NotifyObservers(); + } + data.WrappedData.NotifyObservers(); + } } } \ No newline at end of file