Constrain Extent Behavior

This sample demonstrates the constrain extent behavior, which forces a Map control to stay within a specified extent. When using the sample, attempt to pan or zoom outside of the initial extent and observe that the Map control forces the extent back to the constraint. The sample XAML shows that using this behavior only requires declaring it within a Map element and specifying the extent to constrain the map within.

Download Sample Application
XAML C# VB.NET
<UserControl x:Class="ArcGISWPFSDK.LocalConstrainExtentBehavior"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" 
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:esri="http://schemas.esri.com/arcgis/client/2009"   
    xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" mc:Ignorable="d" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" d:DesignHeight="33" d:DesignWidth="69">
    <Grid x:Name="LayoutRoot" >
        <esri:Map x:Name="MyMap" WrapAround="True" Extent="-15000000,2000000,-7000000,8000000" MinimumResolution="2445.98490512499">
            <esri:ArcGISLocalTiledLayer ID="Shaded Relief" Path="..\\Data\\TPKs\\Topographic.tpk"/>
            <i:Interaction.Behaviors>
                <esri:ConstrainExtentBehavior ConstrainedExtent="-15000000,2000000,-7000000,8000000" />
            </i:Interaction.Behaviors>
        </esri:Map>
    </Grid>
</UserControl>

Sample code usage restrictions
5/16/2014