ArcGIS Pro 3.7 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 Function IsVisibleInView( _
       ByVal mapView As MapView _
    ) As Boolean
    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 current map view
    {
      if (layer == null)
      {
        // no layers in the map, leave
      }
      if (mapView == null)
      {
        // no active map view, leave
      }
      bool isLayerVisibleInView = layer.IsVisibleInView(mapView);
      if (isLayerVisibleInView)
      {
        //Do Something
      }
    }
    Requirements

    Target Platforms: Windows 11 Home, Pro, Enterprise (64 bit)

    ArcGIS Pro version: 3.0 or higher.
    See Also