Beispiel #1
0
        //Open the info window (with the retrieved photo) when mouse enters the pushpin graphic
        void graphicsLayer_MouseEnter(object sender, client.GraphicMouseEventArgs e)
        {
            //Get the pushpin graphic we are interested in
            client.Graphic pushpin = e.Graphic;

            //Get the photoInfo object associated with the pushpin graphic
            //From the photoInfo object we will get the URL of the photo
            var photoInfo = photoInfos.FirstOrDefault(pi => pi.Location.X == (pushpin.Geometry as MapPoint).X && pi.Location.Y == (pushpin.Geometry as MapPoint).Y);

            if (photoInfo == null)
            {
                return;
            }

            //Set the content of the info window to the target photoInfo
            //Specify the location where it should open
            //Then open it
            MyInfoWindow.Content   = photoInfo;
            MyInfoWindow.Anchor    = pushpin.Geometry as MapPoint;
            MyInfoWindow.Placement = client.Toolkit.InfoWindow.PlacementMode.Bottom;
            MyInfoWindow.IsOpen    = true;
        }
Beispiel #2
0
 //Close the info window when mouse leaves
 void graphicsLayer_MouseLeave(object sender, client.GraphicMouseEventArgs e)
 {
     MyInfoWindow.IsOpen = false;
 }
 /// <summary>
 /// React on mouse move on graphic.
 /// </summary>
 /// <param name="sender">Ignored.</param>
 /// <param name="e">Graphic, which under mouse.</param>
 private void _GraphicsLayerMouseMove(object sender, ESRI.ArcGIS.Client.GraphicMouseEventArgs e)
 {
     PointedGraphic = e.Graphic;
 }