public Coordinates()
{
InitializeComponent();
_dispatcherTimer = new DispatcherTimer();
_dispatcherTimer.Interval = new TimeSpan(0, 0, 0, 0, 350);
_dispatcherTimer.Tick += (s, ex) =>
{
ScreenCoordsTextBlock.Text = string.Format("Screen Coordinates:\r\n X = {0}, Y = {1}",
_currentScreenPoint.X, _currentScreenPoint.Y);
ESRI.ArcGIS.Client.Geometry.MapPoint mapPoint = MyMap.ScreenToMap(_currentScreenPoint);
if (MyMap.WrapAroundIsActive)
mapPoint = ESRI.ArcGIS.Client.Geometry.Geometry.NormalizeCentralMeridian(mapPoint) as ESRI.ArcGIS.Client.Geometry.MapPoint;
MapCoordsTextBlock.Text = string.Format("Map Coordinates:\r\n X = {0}, Y = {1}",
Math.Round(mapPoint.X, 4), Math.Round(mapPoint.Y, 4));
GraphicsLayer graphicsLayer = MyMap.Layers["MyGraphicsLayer"] as GraphicsLayer;
graphicsLayer.Graphics[0].Geometry = mapPoint;
_dispatcherTimer.Stop();
};
}