TreeHelper.

GetChildObjects(DependencyObject, bool) Method

Summary

This method is an alternative to WPF's VisualTreeHelper.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.
Namespace
MahApps.Metro.Controls
Containing Type
TreeHelper

Syntax

public static IEnumerable<DependencyObject> GetChildObjects(this DependencyObject parent, bool forceUsingTheVisualTreeHelper = false)

Parameters

Name Type Description
parent DependencyObject The item to be processed.
forceUsingTheVisualTreeHelper bool Sometimes it's better to search in the VisualTree (e.g. in tests)

Return Value

Type Description
IEnumerable<DependencyObject> The submitted item's child elements, if available.