Table of Contents

Method TryFindChild

Namespace
Alternet.FormDesigner.Wpf
Assembly
Alternet.FormDesigner.Wpf.v10.dll

TryFindChild<T>(DependencyObject)

Returns the first child of the specified type found in the visual tree.

public static T TryFindChild<T>(this DependencyObject parent) where T : DependencyObject

Parameters

parent DependencyObject

The parent element where the search is started.

Returns

T

The first child of the specified type found in the visual tree, or null if no parent of the specified type is found.

Type Parameters

T

TryFindChild<T>(DependencyObject, string)

Returns the first child of the specified type and with the specified name found in the visual tree.

public static T TryFindChild<T>(this DependencyObject parent, string childName) where T : DependencyObject

Parameters

parent DependencyObject

The parent element where the search is started.

childName string

The name of the child element to find, or an empty string or null to only look at the type.

Returns

T

The first child that matches the specified type and child name, or null if no match is found.

Type Parameters

T