Index: Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailureMechanismProperties.cs =================================================================== diff -u -rdeaf745326ef9c8e2f9d33279705b8549ef748fb -r50f75d6083408942576a173c4c2064803f80c560 --- Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailureMechanismProperties.cs (.../ClosingStructuresFailureMechanismProperties.cs) (revision deaf745326ef9c8e2f9d33279705b8549ef748fb) +++ Ringtoets/ClosingStructures/src/Ringtoets.ClosingStructures.Forms/PropertyClasses/ClosingStructuresFailureMechanismProperties.cs (.../ClosingStructuresFailureMechanismProperties.cs) (revision 50f75d6083408942576a173c4c2064803f80c560) @@ -20,9 +20,7 @@ // All rights reserved. using System; -using System.Collections.Generic; using System.ComponentModel; -using Core.Common.Base; using Core.Common.Base.Data; using Core.Common.Gui.Attributes; using Core.Common.Gui.PropertyBag; @@ -53,51 +51,28 @@ private const int modelFactorSubCriticalFlowPropertyIndex = 10; private const int modelFactorInflowVolumePropertyIndex = 11; - 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. - /// Thrown when any input parameter is null. - public ClosingStructuresFailureMechanismProperties( - ClosingStructuresFailureMechanism data, - IFailureMechanismPropertyChangeHandler handler) + /// Thrown when + /// is null. + public ClosingStructuresFailureMechanismProperties(ClosingStructuresFailureMechanism data) { if (data == null) { throw new ArgumentNullException(nameof(data)); } - if (handler == null) - { - throw new ArgumentNullException(nameof(handler)); - } - Data = data; - propertyChangeHandler = handler; } [DynamicVisibleValidationMethod] public bool DynamicVisibleValidationMethod(string propertyName) { - if (!data.IsRelevant && ShouldHidePropertyWhenFailureMechanismIrrelevant(propertyName)) - { - return false; - } - - return true; + return data.IsRelevant || !ShouldHidePropertyWhenFailureMechanismIrrelevant(propertyName); } - private static void NotifyAffectedObjects(IEnumerable affectedObjects) - { - foreach (IObservable affectedObject in affectedObjects) - { - affectedObject.NotifyObservers(); - } - } - private bool ShouldHidePropertyWhenFailureMechanismIrrelevant(string propertyName) { return nameof(GravitationalAcceleration).Equals(propertyName)