Hi,I am trying to get a list of graphics that's currently visible on the map using the FindGraphicsInHostCoordinates() method. I pass in a Rect of the area on the screen where the map is displayed. Most of the time this works. However, once in a while I would get the following exception. I call this method while I handle the Map.ExtentChanged event. Any idea what's going on here or how I can get around this?Thanks.
Specified index is out of range or child at index is null. Do not call this method if VisualChildrenCount returns zero, indicating that the Visual has no children.
Parameter name: index
Actual value was 0.
at System.Windows.FrameworkElement.GetVisualChild(Int32 index)
at System.Windows.Media.Visual.InternalGet2DOr3DVisualChild(Int32 index)
at System.Windows.Media.VisualTreeHelper.GetChild(DependencyObject reference, Int32 childIndex)
at ESRI.ArcGIS.Client.Symbols.GraphicElement.HitTestCore(GeometryHitTestParameters hitTestParameters)
at System.Windows.Media.Visual.HitTestGeometry(HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, GeometryHitTestParameters geometryParams)
at System.Windows.Media.Visual.HitTestGeometry(HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, GeometryHitTestParameters geometryParams)
at System.Windows.Media.Visual.HitTest(HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, HitTestParameters hitTestParameters)
at System.Windows.Media.VisualTreeHelper.HitTest(Visual reference, HitTestFilterCallback filterCallback, HitTestResultCallback resultCallback, HitTestParameters hitTestParameters)
at ESRI.ArcGIS.Client.GraphicsLayer.FindGraphicsInHostCoordinates(Rect intersectingRect, Int32 maxHits)
at VTM.EsriMapControl.Common.LabelStacker.GetVisibleLabels()