Solved! Go to Solution.
FindGraphicsInHostCoordinates(Point intersectingPoint, int maxHits)
FindGraphicsInHostCoordinates(Rect intersectingRect, int maxHits)
private void IdentifyTask(ESRI.ArcGIS.Client.Geometry.Geometry geom) { var initialMapPoint = new MapPoint(geom.Extent.XMin, geom.Extent.YMin); var finalMapPoint = new MapPoint(geom.Extent.XMax, geom.Extent.YMax); var initialPoint = this.myModelMap.MapToScreen(initialMapPoint); var finalpoint = this.myModelMap.MapToScreen(finalMapPoint); var intialRect = this.myModelMap.PointToScreen(initialPoint); var finalRect = this.myModelMap.PointToScreen(finalpoint); var generalTransform = this.myModelMap.TransformToVisual(Application.Current.MainWindow); var initialTransformedScreenPoint = generalTransform.Transform(intialRect); var finalTransformedScreenPoint = generalTransform.Transform(finalRect); var selectionRect = new Rect(initialTransformedScreenPoint, finalTransformedScreenPoint); var identifyResult = new Dictionary<string, IEnumerable<Graphic>>(); this.IdentifyPointInLayer(identifyResult, this.VisibleLayers, selectionRect); foreach (var layer in identifyResult) { System.Text.StringBuilder displayString = new System.Text.StringBuilder(); displayString.Append("Number of Graphics Selected: " + layer.Value.Count().ToString() + Environment.NewLine + Environment.NewLine); System.Windows.Forms.MessageBox.Show(displayString.ToString()); } } private void IdentifyPointInLayer(Dictionary<string, IEnumerable<Graphic>> dictionary, LayerCollection layers, Rect point) { foreach (Layer layer in layers) { if (layer is GraphicsLayer) { var identifyResultPerLayer = (layer as GraphicsLayer).FindGraphicsInHostCoordinates(point, 10); dictionary.Add(layer.DisplayName, identifyResultPerLayer); } if (layer is GroupLayer) { this.IdentifyPointInLayer(dictionary, (layer as GroupLayer).ChildLayers, point); } } }