ArcGIS Runtime SDK for WPF - Library Reference
HitTestAsync(Rect,Int32,MessageLayerHitTestBehavior,Action<IList<Message>>) Method
See Also 
ESRI.ArcGIS.Client.AdvancedSymbology Namespace > MessageLayer Class > HitTestAsync Method : HitTestAsync(Rect,Int32,MessageLayerHitTestBehavior,Action<IList<Message>>) Method

intersectingRect
A System.Windows.Rect representing an area on the map in screen coordinates.
maxHits
A System.Int32 representing the maximum number of hits to retrieve. Use this parameter to improve performance.
hitTestBehavior
A MessageLayerHitTestBehavior value determining how hit test calls are filtered to improve performance.
resultCallback
The Action that will be called with the hit test result as a IList of Messages. If no Message was hit, null will be passed to the callback.
Returns the visible messages within the specified screen area as defined by a rectangle. Use the maxHits parameter to restrict the search and improve performance.

Syntax

Visual Basic (Declaration) 
Public Overloads Sub HitTestAsync( _
   ByVal intersectingRect As Rect, _
   ByVal maxHits As Integer, _
   ByVal hitTestBehavior As MessageLayerHitTestBehavior, _
   ByVal resultCallback As Action(Of IList(Of Message)) _
) 

Remarks

Note that is is necessary to account for the difference between Map and application origin by using code similar to the following to perform a Transform on the input screen Point or Rect:

            GeneralTransform generalTransform = MyMap.TransformToVisual(Application.Current.MainWindow);
            System.Windows.Point transformScreenPnt = generalTransform.Transform(e.ScreenPoint);
            System.Windows.Rect transformScreenRect = new Rect(transformScreenPnt, new Size(100, 100));
            

Parameters

intersectingRect
A System.Windows.Rect representing an area on the map in screen coordinates.
maxHits
A System.Int32 representing the maximum number of hits to retrieve. Use this parameter to improve performance.
hitTestBehavior
A MessageLayerHitTestBehavior value determining how hit test calls are filtered to improve performance.
resultCallback
The Action that will be called with the hit test result as a IList of Messages. If no Message was hit, null will be passed to the callback.

Requirements

Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8

See Also

© ESRI, Inc. All Rights Reserved.