Exemple #1
0
        private void GraphicsLayer_MouseLeftButtonDown(object sender, ESRI.ArcGIS.Client.GraphicMouseButtonEventArgs e)
        {
            // close any open MapTip
            MapTip.IsOpen = false;

            // show the map tip for the graphic
            MapTip.DataContext = e.Graphic;
            MapTip.Anchor      = MyMap.ScreenToMap(e.GetPosition(ContentPanel));
            MapTip.IsOpen      = true;
        }
        /// <summary>
        /// React on mouse left button down.
        /// </summary>
        /// <param name="sender">Ignored.</param>
        /// <param name="e">Graphic, which was clicked by left button.</param>
        private void _GraphicsLayerMouseLeftButtonDown(object sender, ESRI.ArcGIS.Client.GraphicMouseButtonEventArgs e)
        {
            _clickedGraphic = e.Graphic;

            if (_tools.CurrentTool != null)
            {
                // Get the x and y coordinates of the mouse pointer.
                System.Windows.Point position   = e.GetPosition(_mapControl.map);
                MapPoint             pointOnMap = _mapControl.map.ScreenToMap(position);

                e.Handled = true;

                _tools.CurrentTool.OnMouseDown(MouseButton.Left,
                                               Keyboard.Modifiers, pointOnMap.X, pointOnMap.Y);
            }

            // Unexpand cluster if needed.
            bool graphicIsInExpandedLayer = _clustering.ClusteringLayer.MapLayer.Graphics.Contains(e.Graphic);

            if (_clustering.ExpandedClusterGraphic != e.Graphic && !graphicIsInExpandedLayer)
            {
                _clustering.UnexpandIfExpanded();
            }
        }
 /// <summary>
 /// React on mouse left button up.
 /// </summary>
 /// <param name="sender">Ignored.</param>
 /// <param name="e">Graphic, which was clicked by left button.</param>
 private void _GraphicsLayerMouseLeftButtonUp(object sender, ESRI.ArcGIS.Client.GraphicMouseButtonEventArgs e)
 {
     _mapSelectionManager.ProcessGraphicMouseEvents(e.Graphic, _clickedGraphic);
 }