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

In This Topic
    IsVisibleInView(MapView) Method
    In This Topic
    Determines whether the layer is visible in the given map view
    Syntax
    public bool IsVisibleInView( 
       MapView mapView
    )
    Public Function IsVisibleInView( _
       ByVal mapView As MapView _
    ) As Boolean

    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