FrameworkElementExtensions.FindParents(FrameworkElement) Method

Definition

Find all parent elements of the specified element. This method can be chained with LINQ calls to add additional filters or projections on top of the returned results.

This method is meant to provide extra flexibility in specific scenarios and it should not be used when only the first item is being looked for. In those cases, use one of the available FindParent<T>(FrameworkElement) overloads instead, which will offer a more compact syntax as well as better performance in those cases.

public static System.Collections.Generic.IEnumerable<Windows.UI.Xaml.FrameworkElement> FindParents (this Windows.UI.Xaml.FrameworkElement element);
static member FindParents : Windows.UI.Xaml.FrameworkElement -> seq<Windows.UI.Xaml.FrameworkElement>
<Extension()>
Public Iterator Function FindParents (element As FrameworkElement) As IEnumerable(Of FrameworkElement)

Parameters

element
Windows.UI.Xaml.FrameworkElement

The root element.

Returns

IEnumerable<Windows.UI.Xaml.FrameworkElement>

All the parent Windows.UI.Xaml.FrameworkElement instance from element.

Applies to