ArcGIS Pro 2.9 API Reference Guide
IsExpanded Property (Layer)

ArcGIS.Desktop.Mapping Namespace > Layer Class : IsExpanded Property
Gets whether the layer is expanded or collapsed on the TOC.
Syntax
public bool IsExpanded {get;}
Public ReadOnly Property IsExpanded As Boolean
Requirements

Target Platforms: Windows 11, Windows 10, Windows 8.1

See Also

Reference

Layer Class
Layer Members