Click or drag to resize
MapViewExtentChanged Event
Occurs when map extent changed.

Namespace: Esri.ArcGISRuntime.Controls
Assembly: Esri.ArcGISRuntime (in Esri.ArcGISRuntime.dll) Version: (
public event EventHandler ExtentChanged


Type: SystemEventHandler

Shows how to set the initial extent of the map (Map.InitialViewpoint) in code.

Code example using the Map.ExtentChanged Event.

<Window x:Class="InitialMapExtentCode.MainWindow"
        Height="600" Width="800">


            <!-- Display the MapView.Extent to the user. -->
            <TextBlock Text="Current Map.Extent:" HorizontalAlignment="Center"/>
            <TextBox x:Name="myCoords" Height="25" TextAlignment="Center"/>

            <!-- Add a MapView Control. -->
            <esri:MapView x:Name="MapView1" Height="575">

                <!-- Add a Map. -->
                <esri:Map x:Name="MyMap"  >

                    <!-- Add an ArcGISTiledMapServiceLayer. -->
                        ServiceUri="" />




SPECIAL NOTE: The XAML displayed above comes from a C# project. If you are a VB.NET developer, you will need to modify the text for the x:Class namespace from "InitialMapExtentCode.MainWindow" to be just "MainWindow".

// NOTE: Shows how to set the initial extent of the map (Map.InitialExtent) in code.

namespace InitialMapExtentCode
    public partial class MainWindow : System.Windows.Window
        public MainWindow()

            // Define a SpatialReference using the WKID of 102100 (i.e. Web Mercator). Note that the 
            // SpatialReference.Create is a static/Shared function and hence you do not use the 'new'
            // keyword. 
            Esri.ArcGISRuntime.Geometry.SpatialReference mySpatialReference = null;
            mySpatialReference = Esri.ArcGISRuntime.Geometry.SpatialReference.Create(102100);

            // Create an envelope that has the spatial extent of the Rochester, NY region using the Web Mercator
            // SpatialReference.
            Esri.ArcGISRuntime.Geometry.Envelope myEnvelope = null;
            myEnvelope = new Esri.ArcGISRuntime.Geometry.Envelope(-8669706, 5265422, -8538812, 5361422, mySpatialReference);

            // Set the initial extent of the Map (via InitialViewpoint Property) the to that of our Envelope.
            MapView1.Map.InitialViewpoint = new Esri.ArcGISRuntime.Controls.Viewpoint(myEnvelope);

            // Define an Event Handler to fire each time the Map.Extent changes.
            MapView1.ExtentChanged += myMap_ExtentChanged;


        private void myMap_ExtentChanged(object sender, System.EventArgs e)

            // Display the current Map.Extent back to the user in the application.
            myCoords.Text = MapView1.Extent.ToString();


See Also
Supported Platforms
This type is supported on the following ArcGIS Runtime .NET SDK platforms:
Windows Desktop
Windows Phone
Windows Store
Additional Examples
Hyperlink to ExampleDescription
InitialMapExtentCodeShows how to set the initial extent of the map (Map.InitialExtent) in code.