TreeHelper
Helper methods for UI-related tasks.
This class was obtained from Philip Sumi (a fellow WPF Disciples blog)
http://www.hardcodet.net/uploads/2009/06/UIHelper.cs
public static T FindChild<T>(this DependencyObject parent, string childName) where T : DependencyObject
Finds a Child of a given item in the visual tree.
public static IEnumerable<T> FindChildren<T>(this DependencyObject source, bool forceUsingTheVisualTreeHelper = false) where T : DependencyObject
Analyzes both visual and logical tree in order to find all elements of a given
type that are descendants of the source item.
public static IEnumerable<DependencyObject> GetChildObjects(this DependencyObject parent, bool forceUsingTheVisualTreeHelper = false)
This method is an alternative to WPF's
GetChild method, which also
supports content elements. Keep in mind that for content elements,
this method falls back to the logical tree of the element.
This method is an alternative to WPF's
GetParent method, which also
supports content elements. Keep in mind that for content element,
this method falls back to the logical tree of the element!
Tries to locate a given item within the visual tree,
starting with the dependency object at a given position.
Finds a parent of a given item on the visual tree.