FindElementsInHostCoordinates Method (Point, UIElement)
Collapse the table of content
Expand the table of content

VisualTreeHelper.FindElementsInHostCoordinates Method (Point, UIElement)

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Retrieves a set of objects that are located within a specified point of an object's coordinate space.

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

public static IEnumerable<UIElement> FindElementsInHostCoordinates(
	Point intersectingPoint,
	UIElement subtree


Type: System.Windows.Point
The point to use as the determination point.
Type: System.Windows.UIElement
The object to search within.

Return Value

Type: System.Collections.Generic.IEnumerable<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 subtee.

You must specify some object for the subtree value to specify a frame of reference. If you want to use the most general frame of reference available (the entire content area of Windows Phone), use Application.RootVisual as the subtree input.

For most operations, you will generally be interested only in the first UIElement in the set, which is the element that is visually the topmost rendered element for the visual composition. Any other objects in the collection do not correspond to what would be reported as the source if the user tapped that point area (for instance the user tapped on an enabled and focusable control).

FindElementsInHostCoordinates is fundamentally similar to the HitTest methods in other frameworks.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

© 2017 Microsoft