VisualTreeHelper.FindElementsInHostCoordinates(Rect, UIElement, Boolean) method
Retrieves a set of objects that are located within a specified Rect of an object's coordinate space.
public: static IIterable<UIElement>^ FindElementsInHostCoordinates( Rect intersectingRect, UIElement^ subtree, bool includeAllElements )
The Rect to use as the determination area.
The object to search within.
true to include all elements that intersect, including those elements considered to be invisible to hit testing. false to find only visible, hit-testable elements.
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 subtree.
The return value can have more than one element because there can be multiple UI elements stacked over each other in a z-order. The conventional hit-testing techniques exposed by the input event handlers, such as the sender value for a PointerPressed event, only account for the topmost element in a z-order. FindElementsInHostCoordinates methods return the whole stack of elements that share that point in layout, listed by z-order, and can thus be useful for examining cases where you've intentionally or unintentionally stacked elements, and may want to correct the order for rendering and hit-testing.
If you are programming using C# or Microsoft Visual Basic, the return value type of this method is projected as an IEnumerable generic collection that contains UIElement items. If you are programming using Visual C++ component extensions (C++/CX), the return type of this method is IIterable<UIElement>.
Minimum supported client
Minimum supported server
|Windows Server 2012|
- FindElementsInHostCoordinates(Point, UIElement)
- FindElementsInHostCoordinates(Rect, UIElement)
- FindElementsInHostCoordinates(Point, UIElement, Boolean)
Build date: 11/16/2013