Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/VariationCoefficientDistributionPropertiesBase.cs =================================================================== diff -u -rf861839e975251253e2ffd7bc3f0a1839b85534e -rd5a0bce3d53deb3aef237c365018096e9bc83bb1 --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/VariationCoefficientDistributionPropertiesBase.cs (.../VariationCoefficientDistributionPropertiesBase.cs) (revision f861839e975251253e2ffd7bc3f0a1839b85534e) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/VariationCoefficientDistributionPropertiesBase.cs (.../VariationCoefficientDistributionPropertiesBase.cs) (revision d5a0bce3d53deb3aef237c365018096e9bc83bb1) @@ -20,13 +20,12 @@ // All rights reserved. using System; -using System.Collections.Generic; -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.Data.Probabilistics; +using Ringtoets.Common.Forms.ChangeHandlers; using Ringtoets.Common.Forms.Properties; namespace Ringtoets.Common.Forms.PropertyClasses @@ -105,7 +104,7 @@ throw new InvalidOperationException("Mean is set to be read-only."); } - ChangePropertyAndNotify(() => data.Mean = value); + PropertyChangeHelper.ChangePropertyAndNotify(() => data.Mean = value, changeHandler); } } @@ -125,7 +124,7 @@ throw new InvalidOperationException($"{nameof(CoefficientOfVariation)} is set to be read-only."); } - ChangePropertyAndNotify(() => data.CoefficientOfVariation = value); + PropertyChangeHelper.ChangePropertyAndNotify(() => data.CoefficientOfVariation = value, changeHandler); } } @@ -148,19 +147,5 @@ return data == null ? string.Empty : $"{Mean} ({Resources.Distribution_VariationCoefficient_DisplayName} = {CoefficientOfVariation})"; } - - private void ChangePropertyAndNotify(SetObservablePropertyValueDelegate setPropertyValue) - { - IEnumerable affectedObjects = changeHandler.SetPropertyValueAfterConfirmation(setPropertyValue); - NotifyAffectedObjects(affectedObjects); - } - - private static void NotifyAffectedObjects(IEnumerable affectedObjects) - { - foreach (IObservable affectedObject in affectedObjects) - { - affectedObject.NotifyObservers(); - } - } } } \ No newline at end of file