private void MyMap_MouseClick(object sender, ESRI.ArcGIS.Client.Map.MouseEventArgs e)
        {
            FeatureLayer featureLayer = MyMap.Layers["MyFeatureLayer"] as FeatureLayer;

            System.Windows.Point screenPnt = MyMap.MapToScreen(e.MapPoint);

            // Account for difference between Map and application origin
            GeneralTransform generalTransform = MyMap.TransformToVisual(Application.Current.MainWindow);

            System.Windows.Point transformScreenPnt = generalTransform.Transform(screenPnt);

            IEnumerable <Graphic> selected =
                featureLayer.FindGraphicsInHostCoordinates(transformScreenPnt);

            foreach (Graphic g in selected)
            {
                MyInfoWindow.Anchor = e.MapPoint;
                MyInfoWindow.IsOpen = true;
                //Since a ContentTemplate is defined, Content will define the DataContext for the ContentTemplate
                MyInfoWindow.Content = g.Attributes;
                return;
            }

            InfoWindow window = new InfoWindow()
            {
                Anchor          = e.MapPoint,
                Map             = MyMap,
                IsOpen          = true,
                ContentTemplate = LayoutRoot.Resources["LocationInfoWindowTemplate"] as System.Windows.DataTemplate,
                //Since a ContentTemplate is defined, Content will define the DataContext for the ContentTemplate
                Content = e.MapPoint
            };

            LayoutRoot.Children.Add(window);
        }