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)) _ ) |
C# | |
---|---|
public void HitTestAsync( Rect intersectingRect, int maxHits, MessageLayerHitTestBehavior hitTestBehavior, Action<IList<Message>> resultCallback ) |
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.
Target Platforms: Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family, Windows 7, Windows 8