VisualTreeExtensions
Provides useful extensions for working with the visual tree.
Methods
internal static IEnumerable<FrameworkElement> GetLogicalChildren(FrameworkElement parent)
result = VisualTreeExtensions.GetLogicalChildren(parent)
Retrieves all the logical children of a framework element using a breadth-first search. For performance reasons this method manually manages the stack instead of using recursion.
- parent
- The parent framework element.
Returns: The logical children of the framework element.
internal static IEnumerable<DependencyObject> GetVisualAncestors(DependencyObject element)
result = VisualTreeExtensions.GetVisualAncestors(element)
Get the visual tree ancestors of an element.
- element
- The element.
Returns: The visual tree ancestors of the element.
internal static IEnumerable<DependencyObject> GetVisualAncestorsAndSelf(DependencyObject element)
result = VisualTreeExtensions.GetVisualAncestorsAndSelf(element)
Get the visual tree ancestors of an element and the element itself.
- element
- The element.
Returns: The visual tree ancestors of an element and the element itself.
private static IEnumerable<DependencyObject> GetVisualAncestorsAndSelfIterator(DependencyObject element)
result = VisualTreeExtensions.GetVisualAncestorsAndSelfIterator(element)
Get the visual tree ancestors of an element and the element itself.
- element
- The element.
Returns: The visual tree ancestors of an element and the element itself.
internal static IEnumerable<DependencyObject> GetVisualChildren(DependencyObject element)
result = VisualTreeExtensions.GetVisualChildren(element)
Get the visual tree children of an element.
- element
- The element.
Returns: The visual tree children of an element.
internal static IEnumerable<DependencyObject> GetVisualChildrenAndSelf(DependencyObject element)
result = VisualTreeExtensions.GetVisualChildrenAndSelf(element)
Get the visual tree children of an element and the element itself.
- element
- The element.
Returns: The visual tree children of an element and the element itself.
private static IEnumerable<DependencyObject> GetVisualChildrenAndSelfIterator(DependencyObject element)
result = VisualTreeExtensions.GetVisualChildrenAndSelfIterator(element)
Get the visual tree children of an element and the element itself.
- element
- The element.
Returns: The visual tree children of an element and the element itself.
internal static IEnumerable<DependencyObject> GetVisualDescendants(DependencyObject element)
result = VisualTreeExtensions.GetVisualDescendants(element)
Get the visual tree descendants of an element.
- element
- The element.
Returns: The visual tree descendants of an element.
internal static IEnumerable<DependencyObject> GetVisualDescendantsAndSelf(DependencyObject element)
result = VisualTreeExtensions.GetVisualDescendantsAndSelf(element)
Get the visual tree descendants of an element and the element itself.
- element
- The element.
Returns: The visual tree descendants of an element and the element itself.
private static IEnumerable<DependencyObject> GetVisualDescendantsAndSelfIterator(DependencyObject element)
result = VisualTreeExtensions.GetVisualDescendantsAndSelfIterator(element)
Get the visual tree descendants of an element and the element itself.
- element
- The element.
Returns: The visual tree descendants of an element and the element itself.
internal static IEnumerable<DependencyObject> GetVisualSiblings(DependencyObject element)
result = VisualTreeExtensions.GetVisualSiblings(element)
Get the visual tree siblings of an element.
- element
- The element.
Returns: The visual tree siblings of an element.
internal static IEnumerable<DependencyObject> GetVisualSiblingsAndSelf(DependencyObject element)
result = VisualTreeExtensions.GetVisualSiblingsAndSelf(element)
Get the visual tree siblings of an element and the element itself.
- element
- The element.
Returns: The visual tree siblings of an element and the element itself.
internal static void InvokeOnLayoutUpdated(FrameworkElement element, Action action)
VisualTreeExtensions.InvokeOnLayoutUpdated(element, action)
Perform an action when the element's LayoutUpdated event fires.
- element
- The element.
- action
- The action to perform.