ArcGIS Pro 3.4 API Reference Guide
ArcGIS.Desktop.Mapping Namespace / MapView Class / Extent Property
Example

In This Topic
    Extent Property (MapView)
    In This Topic
    Gets the current extent of the view.
    Syntax
    public Envelope Extent {get;}
    Public ReadOnly Property Extent As Envelope
    Remarks
    Use this in combination with ZoomTo(Geometry,Nullable<TimeSpan>,Boolean) to get and set the view's extent.
    Example
    Expand Extent
    public Task<bool> ExpandExtentAsync(double dx, double dy)
    {
      return QueuedTask.Run(() =>
      {
        //Get the active map view.
        var mapView = MapView.Active;
        if (mapView == null)
          return false;
    
        //Expand the current extent by the given ratio.
        var extent = mapView.Extent;
        var newExtent = ArcGIS.Core.Geometry.GeometryEngine.Instance.Expand(extent, dx, dy, true);
        return mapView.ZoomTo(newExtent);
      });
    }
    
    Requirements

    Target Platforms: Windows 11, Windows 10

    ArcGIS Pro version: 3 or higher.
    See Also