Index: Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Plugin/DuneErosionPlugin.cs =================================================================== diff -u -r8fe9bd87da92837297afa5cc804ccdac8b64900d -rd4a4f6fc0626fe052dc73d5bdba16a28a82e299d --- Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Plugin/DuneErosionPlugin.cs (.../DuneErosionPlugin.cs) (revision 8fe9bd87da92837297afa5cc804ccdac8b64900d) +++ Ringtoets/DuneErosion/src/Ringtoets.DuneErosion.Plugin/DuneErosionPlugin.cs (.../DuneErosionPlugin.cs) (revision d4a4f6fc0626fe052dc73d5bdba16a28a82e299d) @@ -21,6 +21,7 @@ using System; using System.Collections.Generic; +using System.Drawing; using System.Linq; using System.Windows.Forms; using Core.Common.Base; @@ -94,6 +95,9 @@ yield return new TreeNodeInfo { Text = context => RingtoetsCommonDataResources.HydraulicBoundaryConditions_DisplayName, + ForeColor = context => context.WrappedData.Any() + ? Color.FromKnownColor(KnownColor.ControlText) + : Color.FromKnownColor(KnownColor.GrayText), Image = context => RingtoetsCommonFormsResources.GeneralFolderIcon, ContextMenuStrip = DuneLocationCalculationsGroupContextMenuStrip, ChildNodeObjects = DuneLocationCalculationsGroupContextChildNodeObjects Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/DuneErosionPluginTest.cs =================================================================== diff -u -rca120cd6cf35b91c0acf363a4e6fc9638ec3f45f -rd4a4f6fc0626fe052dc73d5bdba16a28a82e299d --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/DuneErosionPluginTest.cs (.../DuneErosionPluginTest.cs) (revision ca120cd6cf35b91c0acf363a4e6fc9638ec3f45f) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/DuneErosionPluginTest.cs (.../DuneErosionPluginTest.cs) (revision d4a4f6fc0626fe052dc73d5bdba16a28a82e299d) @@ -135,7 +135,7 @@ PluginTestHelper.AssertViewInfoDefined( viewInfos, typeof(DuneLocationCalculationsContext), - typeof(IEnumerable), + typeof(IObservableEnumerable), typeof(DuneLocationCalculationsView)); } } Index: Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneLocationCalculationsGroupContextTreeNodeInfoTest.cs =================================================================== diff -u -r2fa288c2dca73f346a31c54f2ac2c89b67387ca9 -rd4a4f6fc0626fe052dc73d5bdba16a28a82e299d --- Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneLocationCalculationsGroupContextTreeNodeInfoTest.cs (.../DuneLocationCalculationsGroupContextTreeNodeInfoTest.cs) (revision 2fa288c2dca73f346a31c54f2ac2c89b67387ca9) +++ Ringtoets/DuneErosion/test/Ringtoets.DuneErosion.Plugin.Test/TreeNodeInfos/DuneLocationCalculationsGroupContextTreeNodeInfoTest.cs (.../DuneLocationCalculationsGroupContextTreeNodeInfoTest.cs) (revision d4a4f6fc0626fe052dc73d5bdba16a28a82e299d) @@ -52,7 +52,7 @@ // Assert Assert.IsNotNull(info.Text); - Assert.IsNull(info.ForeColor); + Assert.IsNotNull(info.ForeColor); Assert.IsNotNull(info.Image); Assert.IsNotNull(info.ContextMenuStrip); Assert.IsNull(info.EnsureVisibleOnCreate); @@ -89,6 +89,53 @@ } [Test] + public void ForeColor_LocationsEmpty_ReturnGrayText() + { + // Setup + var assessmentSection = new AssessmentSectionStub(); + var failureMechanism = new DuneErosionFailureMechanism(); + var locations = new ObservableList(); + + var calculationsGroupContext = new DuneLocationCalculationsGroupContext(locations, failureMechanism, assessmentSection); + + using (var plugin = new DuneErosionPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + Color textColor = info.ForeColor(calculationsGroupContext); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.GrayText), textColor); + } + } + + [Test] + public void ForeColor_WithLocations_ReturnControlText() + { + // Setup + var assessmentSection = new AssessmentSectionStub(); + var failureMechanism = new DuneErosionFailureMechanism(); + var locations = new ObservableList + { + new TestDuneLocation() + }; + + var calculationsGroupContext = new DuneLocationCalculationsGroupContext(locations, failureMechanism, assessmentSection); + + using (var plugin = new DuneErosionPlugin()) + { + TreeNodeInfo info = GetInfo(plugin); + + // Call + Color textColor = info.ForeColor(calculationsGroupContext); + + // Assert + Assert.AreEqual(Color.FromKnownColor(KnownColor.ControlText), textColor); + } + } + + [Test] public void Image_Always_ReturnsGeneralFolderIcon() { // Setup