VisualTreeAssist ClassDW.WPFToolkit Documentation
Brings many possibilities to find elements in the visual tree. See VisualTreeHelper.
Inheritance Hierarchy

SystemObject
  DW.WPFToolkit.HelpersVisualTreeAssist

Namespace: DW.WPFToolkit.Helpers
Assembly: DW.WPFToolkit (in DW.WPFToolkit.dll) Version: 5.6.0.0
Syntax

C#
public static class VisualTreeAssist

The VisualTreeAssist type exposes the following members.

Methods

  NameDescription
Public methodStatic memberFindChildTChildType
Searches for a specific child element by its type.
Public methodStatic memberFindNamedChild(DependencyObject, String)
Searches for a specific child element by its name.
Public methodStatic memberFindNamedChildTChildType(DependencyObject, String)
Searches for a specific child element by its type and name
Public methodStatic memberFindNamedParent(DependencyObject, String)
Searches for a parent control by its name.
Public methodStatic memberFindNamedParentTParentType(DependencyObject, String)
Searches for a parent control by its type and name.
Public methodStatic memberFindParentTParentType
Searches for a parent control by its type.
Public methodStatic memberGetChildrenTChildType
Gets all child elements with a specific type.
Public methodStatic memberGetChildrenCountTChildType
Gets the amount of child elements by their type.
Public methodStatic memberGetParentCountTParentType
Gets the amount of parent controls which are the given type.
Public methodStatic memberGetParentsTParentType
Gets all parent controls with the specific type.
Public methodStatic memberGetParentsUntilTParentType, TEndType
Gets all parent controls with the specific type as long no control with the second control type is found.
Public methodStatic memberGetParentsUntilCountTParentType, TEndType
Gets the amount of parent controls which are the given type as long no control with the second control type is found.
Top
Examples

C#
var childButton = VisualTreeAssist.FindChild<Button>(this);

var namedChildTextBox = VisualTreeAssist.FindNamedChild<TextBox>(this, "PART_TextBox");

var firstUserControlInWindow = VisualTreeAssist.GetParentsUntil<UserControl, Window>(this);
See Also

Reference