private void MyMap_MapGesture(object sender, Map.MapGestureEventArgs e)
{
if (e.Gesture == GestureType.Tap &&
!facilitiesEditor.CancelActive.CanExecute(null) &&
!incidentsEditor.CancelActive.CanExecute(null) &&
!barriersEditor.CancelActive.CanExecute(null))
{
MyRouteInfoWindow.IsOpen = false;
GraphicsLayer graphicsLayer = MyMap.Layers["MyRoutesGraphicsLayer"] as GraphicsLayer;
IEnumerable<Graphic> selected = e.DirectlyOver(10, new GraphicsLayer[] { graphicsLayer });
foreach (Graphic g in selected)
{
MyRouteInfoWindow.Anchor = e.MapPoint;
MyRouteInfoWindow.IsOpen = true;
MyRouteInfoWindow.DataContext = g;
return;
}
}
}