void WebMapFeatureServicePopups_MouseLeftButtonUp(object sender, GraphicMouseButtonEventArgs e)
{
FeatureLayer flayer = sender as FeatureLayer;
MapPoint clickPoint = MyMap.ScreenToMap(e.GetPosition(MyMap));
if (clickPoint != lastPoint)
{
if (flayer.GetValue(Document.PopupTemplateProperty) != null)
{
DataTemplate dt = flayer.GetValue(Document.PopupTemplateProperty) as DataTemplate;
MyInfoWindow.Anchor = clickPoint;
MyInfoWindow.ContentTemplate = dt;
MyInfoWindow.Content = e.Graphic.Attributes;
MyInfoWindow.IsOpen = true;
lastPoint = clickPoint;
}
}
}