Show Mouse Coordinates Online

This sample demonstrates how mouse move events on the Map are handled to return the mouse cursor location over the map. The location is displayed in pixels and map units.
Download Sample Application<UserControl x:Class="ArcGISWPFSDK.MouseCoords" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:esri="clr-namespace:ESRI.ArcGIS.Client;assembly=ESRI.ArcGIS.Client" xmlns:esriGeometry="clr-namespace:ESRI.ArcGIS.Client.Geometry;assembly=ESRI.ArcGIS.Client"> <Grid x:Name="LayoutRoot" Background="White"> <Grid.Resources> <LinearGradientBrush x:Key="PanelGradient" EndPoint="0.5,1" StartPoint="0.5,0"> <LinearGradientBrush.RelativeTransform> <TransformGroup> <ScaleTransform CenterY="0.5" CenterX="0.5"/> <SkewTransform CenterY="0.5" CenterX="0.5"/> <RotateTransform Angle="176" CenterY="0.5" CenterX="0.5"/> <TranslateTransform/> </TransformGroup> </LinearGradientBrush.RelativeTransform> <GradientStop Color="#FF145787" Offset="0.16"/> <GradientStop Color="#FF3D7FAC" Offset="0.502"/> <GradientStop Color="#FF88C5EF" Offset="0.984"/> </LinearGradientBrush> </Grid.Resources> <esri:Map x:Name="MyMap" MouseMove="MyMap_MouseMove" WrapAround="True" Background="#FFE3E3E3"> <esri:ArcGISTiledMapServiceLayer ID="myLayer" Url="http://services.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/> </esri:Map> <Grid Width="355" Height="60" HorizontalAlignment="Right" VerticalAlignment="Top" Margin="0,15,15,0" > <Rectangle RadiusX="10" RadiusY="10" Fill="#22000000" Margin="0,4,0,0" /> <Rectangle Stroke="Gray" RadiusX="10" RadiusY="10" Fill="{StaticResource PanelGradient}" /> <Rectangle Fill="#FFFFFFFF" Stroke="DarkGray" RadiusX="5" RadiusY="5" Margin="6" /> <StackPanel Canvas.Left="20" Canvas.Top="14" Margin="20,14,10,0"> <TextBlock x:Name="ScreenCoordsTextBlock" Foreground="Black" HorizontalAlignment="Left" VerticalAlignment="Center" Text="Screen Coords: " TextWrapping="Wrap" FontWeight="Bold" /> <TextBlock x:Name="MapCoordsTextBlock" Foreground="Black" HorizontalAlignment="Left" VerticalAlignment="Center" Text="Map Coords: " TextWrapping="Wrap" FontWeight="Bold" /> </StackPanel> </Grid> </Grid> </UserControl>
5/16/2014