[This is preliminary documentation and is subject to change.]

Enumerates all the visual children of given DependencyObject of given type

Namespace: Tools.WindowsT.WPF
Assembly: Tools.Windows (in Tools.Windows.dll) Version: 1.5.3.38916 (1.5.3.38916)

Syntax

C#
public static IEnumerable<T> FindVisualChildren<T>(
	this DependencyObject parent,
	bool onlyFirstLevel
)
where T : DependencyObject
Visual Basic
<ExtensionAttribute> _
Public Shared Function FindVisualChildren(Of T As DependencyObject) ( _
	parent As DependencyObject, _
	onlyFirstLevel As Boolean _
) As IEnumerable(Of T)
Visual C++
[ExtensionAttribute]
public:
generic<typename T>
where T : DependencyObject
static IEnumerable<T>^ FindVisualChildren(
	DependencyObject^ parent, 
	bool onlyFirstLevel
)
F#
static member FindVisualChildren : 
        parent:DependencyObject * 
        onlyFirstLevel:bool -> IEnumerable<'T>  when 'T : DependencyObject
JScript
JScript does not support generic types or methods.

Parameters

parent
Type: System.Windows..::..DependencyObject
A DependencyObject to look for children in
onlyFirstLevel
Type: System..::..Boolean
True not to look inside objects of type T, false to enumerate children of these objects recursivelly.

Type Parameters

T
Type (derived from DependencyObject) to to serach for children of

Return Value

Visual children of parent of type T. If onlyFirstLevel is false search is done inside these objects as well and objects are returned in in-order order.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DependencyObject. When you use instance method syntax to call this method, omit the first parameter. For more information, see or .

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionparent is null.

See Also

Collapse/expand Version History

1.5.3

  • This function is new in version 1.5.3