Solved! Go to Solution.
private void MyMap_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (e.ClickCount == 2) { var graphicslayer = MyMap.Layers.OfType<GraphicsLayer>().First(); //Grab graphics layer var graphics = graphicslayer.FindGraphicsInHostCoordinates(e.GetPosition(null)); //find any graphics over clickpoint var topGraphic = graphics.FirstOrDefault(); //grab the first hit if (topGraphic != null) //we hit a graphic { e.Handled = true; //prevent map from zooming MessageBox.Show("You dbl clicked a graphic"); } } }
Graphic graphic; TimeSpan elapsedTime; DateTime? startTime; private void FeatureLayer_MouseLeftButtonDown(object sender, GraphicMouseButtonEventArgs e) { if (graphic == null || graphic != e.Graphic) { graphic = e.Graphic; startTime = DateTime.Now; } else if (graphic == e.Graphic && startTime.HasValue) { elapsedTime = DateTime.Now.Subtract(startTime.Value); if (elapsedTime.TotalMilliseconds < 500) { //double click happened } graphic = null; startTime = null; } }
private void MyMap_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { if (e.ClickCount == 2) { var graphicslayer = MyMap.Layers.OfType<GraphicsLayer>().First(); //Grab graphics layer var graphics = graphicslayer.FindGraphicsInHostCoordinates(e.GetPosition(null)); //find any graphics over clickpoint var topGraphic = graphics.FirstOrDefault(); //grab the first hit if (topGraphic != null) //we hit a graphic { e.Handled = true; //prevent map from zooming MessageBox.Show("You dbl clicked a graphic"); } } }