ArcGIS Pro 3.7 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / Active Property
Example

In This Topic
    Active Property (MapView)
    In This Topic
    Gets the active map view. Returns null if there is no active map view.
    Syntax
    Public Shared ReadOnly Property Active As MapView
    public static MapView Active {get;}
    Example
    Get the active map
    {
        //This is how you get the active map
        var mapToGet = MapView.Active?.Map;
    }
    Get the active map's name
    {
      //Return the name of the map currently displayed in the active map view.
      var result = mapView.Map.Name;
      // Use the result variable as needed
    }
    Requirements

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

    ArcGIS Pro version: 3.0 or higher.
    See Also