ArcGIS Pro 3.3 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / Layer Class / IsVisibleInView(MapView) Method
The mapview against which the layer visibility is checked
Example Version

    IsVisibleInView(MapView) Method
    Determines whether the layer is visible in the given map view
    Syntax
    public bool IsVisibleInView( 
       MapView mapView
    )

    Parameters

    mapView
    The mapview against which the layer visibility is checked

    Return Value

    Remarks
    If the mapView is null the value of layer.IsVisible is returned.
    Example
    Check if Layer is visible in the given map view
    var mapView = MapView.Active;
    var layer = mapView.Map.GetLayersAsFlattenedList().OfType<Layer>().FirstOrDefault();
    if (mapView == null) return;
    bool isLayerVisibleInView = layer.IsVisibleInView(mapView);
    if (isLayerVisibleInView)
    {
      //Do Something
    }
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also