This question was posted recently by Ted Chapin @Ted"How do you get the map coordinates of a tool's click location?"
Here is a code snippet to do this:
protected override void OnToolMouseDown(MapViewMouseButtonEventArgs e)
{
if (e.ChangedButton == MouseButton.Left)
e.Handled = true;//Let Framework know we want to handle MouseDown asynchronously
}
private MapPoint _lastClickedMapPoint = null;
protected override async Task HandleKeyDownAsync(MapViewKeyEventArgs k)
{
_lastClickedMapPoint = await QueuedTask.Run(() => ActiveMapView.ClientToMap(k.ClientPoint));
//TODO - do something with _lastClickedMapPoint
}
Thanks
Uma Harano
ArcGIS Desktop SDK Team