Index: Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionsProperties.cs =================================================================== diff -u -rb19983374f4a64979bbb5167bcab288a921aa5e5 -r23a6dd9ff6a575884879762e0e4aff01e21611ea --- Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionsProperties.cs (.../FailureMechanismSectionsProperties.cs) (revision b19983374f4a64979bbb5167bcab288a921aa5e5) +++ Ringtoets/Common/src/Ringtoets.Common.Forms/PropertyClasses/FailureMechanismSectionsProperties.cs (.../FailureMechanismSectionsProperties.cs) (revision 23a6dd9ff6a575884879762e0e4aff01e21611ea) @@ -23,6 +23,7 @@ using System.Collections.Generic; using System.ComponentModel; using System.Linq; +using Core.Common.Base; using Core.Common.Gui.Attributes; using Core.Common.Gui.Converters; using Core.Common.Gui.PropertyBag; @@ -37,19 +38,31 @@ /// public class FailureMechanismSectionsProperties : ObjectProperties> { + private readonly Observer failureMechanismObserver; + /// /// Creates a new instance of . /// /// The sections to show the properties for. - /// Thrown when - /// is null. - public FailureMechanismSectionsProperties(IEnumerable sections) + /// The failure mechanisms which the sections belong to. + /// Thrown when any parameter is null. + public FailureMechanismSectionsProperties(IEnumerable sections, IFailureMechanism failureMechanism) { if (sections == null) { throw new ArgumentNullException(nameof(sections)); } + if (failureMechanism == null) + { + throw new ArgumentNullException(nameof(failureMechanism)); + } + + failureMechanismObserver = new Observer(OnRefreshRequired) + { + Observable = failureMechanism + }; + Data = sections; } @@ -65,5 +78,12 @@ return data.Select(section => new FailureMechanismSectionProperties(section)).ToArray(); } } + + public override void Dispose() + { + failureMechanismObserver.Dispose(); + + base.Dispose(); + } } } \ No newline at end of file