The visibility of GroupLayers is not behaving the way we would expect. We have a layer hierarchy that looks like this:
When we toggle on/off the visibility of the topmost GroupLayer all sub layers toggle on or off with it as expected. When we toggle on/off the FeatureLayers at the bottom of the hierarchy these also toggle on or off as expected. However, when we toggle on/off the middle GroupLayer I would expect all sub layers (a collection of FeatureLayers in our case) to toggle on or off with it, but instead nothing happens.
It would appear that the low level FeatureLayers are reflecting the visibility of the topmost GroupLayer and ignoring the visibility of the mid level group layer. Is this the expected behavior? If so, how can we get the bottom level FeatureLayers to reflect the visibility of the mid level GroupLayer instead?
I have not been able reproduce using the preview Table of Contents control within the Toolkit for ArcGIS Runtime SDK for .NET (arcgis-toolkit-dotnet/TableOfContents.Theme.xaml at main · Esri/arcgis-toolkit-dotnet · GitHub).
Can you share the repro code?
thanks for getting back to me michael. it turns out there is a lot of code to post, and in the meantime we have come up with a potential workaround. i will first see if this workaround will suit our needs before asking you to spend more time looking into this. thanks again!
For the group layer, check the VisibilityMode property on the GroupLayer as that defines how visibility of sublayers inherits visibility of the group layer.
However, in general if a parent layer isn't visible, child layers won't be visible regardless of their visibility setting.