ArcGIS Pro 2.7 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 10, Windows 8.1

See Also

Reference

Layer Class
Layer Members