Pan Buttons
The sample illustrates how to use buttons at standard directions around a map to pan in the direction of the button that was clicked.
Download Sample Application<UserControl x:Class="ArcGISWPFSDK.LocalPanButtons" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:esri="http://schemas.esri.com/arcgis/client/2009"> <Grid x:Name="LayoutRoot"> <esri:Map x:Name="MyMap" WrapAround="True" Extent="-15000000,2000000,-7000000,8000000" Background="#FFE3E3E3" RenderTransformOrigin="0.5,0.5" MinimumResolution="2445.98490512499"> <esri:ArcGISLocalTiledLayer ID="BaseMap" Path="..\\Data\\TPKs\\Topographic.tpk"/> <esri:Map.RenderTransform> <ScaleTransform ScaleX="0.94" ScaleY="0.9" /> </esri:Map.RenderTransform> </esri:Map> <Button FontFamily="Webdings" FontSize="24" Content="3" Tag="W" Height="35" HorizontalAlignment="Left" VerticalAlignment="Center" Width="35" Click="PanClick" /> <Button FontFamily="Webdings" FontSize="24" Content="4" Tag="E" Height="35" HorizontalAlignment="Right" VerticalAlignment="Center" Width="35" Click="PanClick" /> <Button FontFamily="Webdings" FontSize="24" Content="5" Tag="N" Height="35" HorizontalAlignment="Center" VerticalAlignment="Top" Width="35" Click="PanClick" /> <Button FontFamily="Webdings" FontSize="24" Content="6" Tag="S" Height="35" HorizontalAlignment="Center" VerticalAlignment="Bottom" Width="35" Click="PanClick" /> <Button Tag="NE" Height="35" HorizontalAlignment="Right" VerticalAlignment="Top" Width="35" Click="PanClick" > <Button.Content> <TextBlock FontFamily="Webdings" FontSize="24" Text="5" RenderTransformOrigin="0.5,0.5" > <TextBlock.RenderTransform> <RotateTransform Angle="45"/> </TextBlock.RenderTransform> </TextBlock> </Button.Content> </Button> <Button Tag="SE" Height="35" HorizontalAlignment="Right" VerticalAlignment="Bottom" Width="35" Click="PanClick" > <Button.Content> <TextBlock FontFamily="Webdings" FontSize="24" Text="5" RenderTransformOrigin="0.5,0.5" > <TextBlock.RenderTransform> <RotateTransform Angle="135"/> </TextBlock.RenderTransform> </TextBlock> </Button.Content> </Button> <Button Tag="SW" Height="35" HorizontalAlignment="Left" VerticalAlignment="Bottom" Width="35" Click="PanClick" > <Button.Content> <TextBlock FontFamily="Webdings" FontSize="24" Text="5" RenderTransformOrigin="0.5,0.5" > <TextBlock.RenderTransform> <RotateTransform Angle="225"/> </TextBlock.RenderTransform> </TextBlock> </Button.Content> </Button> <Button Tag="NW" Height="35" Width="35" HorizontalAlignment="Left" VerticalAlignment="Top" Click="PanClick" > <Button.Content> <TextBlock FontFamily="Webdings" FontSize="24" Text="5" RenderTransformOrigin="0.5,0.5" > <TextBlock.RenderTransform> <RotateTransform Angle="315"/> </TextBlock.RenderTransform> </TextBlock> </Button.Content> </Button> </Grid> </UserControl>
5/16/2014