VisualTreeHelper.FindElementsInHostCoordinates Method (Rect, Window)


Retrieves a set of objects that are located within a specified Rect of a window's coordinate space.

Namespace:  System.Windows.Media
Assembly:  System.Windows (in System.Windows.dll)

Public Shared Function FindElementsInHostCoordinates ( _
	intersectingRect As Rect, _
	window As Window _
) As IEnumerable(Of UIElement)


Type: System.Windows.Rect
The Rect to use as the determination area.
Type: System.Windows.Window
The window to search within.

Return Value

Type: System.Collections.Generic.IEnumerable(Of UIElement)
An enumerable set of UIElement objects that are determined to be located in the visual tree composition at the specified point and within the specified window.

You must specify some window for the window value to specify a frame of reference.

For this signature, because the determination is done by an area, multiple elements might be returned, and no meaning can be assigned to the order of returned elements in the set.

The input Rect might be the result of a simulated drag action by the mouse, where a start point and end point were captured and could be used to compose a Rect.

FindElementsInHostCoordinates is fundamentally similar to the HitTest methods in previous versions of Silverlight and in WPF.


Supported in: 5

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions