IsVisible and Group Layers

2754
3
12-03-2015 12:14 PM
MarkCederholm
Regular Contributor II

Here's an item for the Wish List:  it would be nice if the IsVisible property of any child of a GroupLayer honored the parent's visibility.  The attached code is a workaround.  On second thought, it might be better to have a separate property for that.

0 Kudos
3 Replies
dotMorten_esri
Esri Frequent Contributor

If a parent group layer is off, all it's children will also be off - is that not what you expect?

The property itself on the child will still be true. This matches how XAML acts : You can have a parent be collapsed and the children are still set to visible. If the visibility of the parent affected the children, it would be a nightmare trying to restore the state back.

0 Kudos
MarkCederholm
Regular Contributor II

Well, the real problem is knowing in code whether or not a layer is truly visible.  The IsVisible property is not a reliable indicator, because it's still set to true even if the parent group layer is not visible.  However, that property IS useful as it currently stands for managing the check state of a TOC entry.  Which is why I would suggest a separate property along the lines of YesYouFoolThisLayerIsGenuinelyNotVisibleRightAtThisMomentOfTime.

0 Kudos
dotMorten_esri
Esri Frequent Contributor

I do understand the need for this - there's a little more to it though - if could also be outside scale range, not initialized yet (or failed to initialize) etc. We do have a plan for solving this scenario for the Quartz releases so it is coming (although I don't think it'll use the property name you suggested 😉 - for now you'd have to write a little code to handle it though.

0 Kudos