ArcGIS Pro 3.0 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / IMapPane Interface / MapView Property
Example

In This Topic
    MapView Property (IMapPane)
    In This Topic
    Gets the map view contained within the pane.
    Syntax
    MapView MapView {get;}
    ReadOnly Property MapView As MapView
    Example
    Get the Unique List of Maps From the Map Panes
    public static IReadOnlyList<Map> GetMapsFromMapPanes()
    {
      //Gets the unique list of Maps from all the MapPanes.
      //Note: The list of maps retrieved from the MapPanes
      //maybe less than the total number of Maps in the project.
      //It depends on what maps the user has actually opened.
      var mapPanes = ProApp.Panes.OfType<IMapPane>()
                  .GroupBy((mp) => mp.MapView.Map.URI).Select(grp => grp.FirstOrDefault());
      List<Map> uniqueMaps = new List<Map>();
      foreach (var pane in mapPanes)
        uniqueMaps.Add(pane.MapView.Map);
      return uniqueMaps;
    }
    Requirements

    Target Platforms: Windows 11, Windows 10, Windows 8.1

    See Also