Table of Contents

Class NameScopeExtensions

Namespace
Avalonia.Controls
Assembly
Avalonia.Base.dll

Extension methods for INameScope.

public static class NameScopeExtensions
Inheritance
NameScopeExtensions
Inherited Members

Methods

FindNameScope(ILogical)

public static INameScope? FindNameScope(this ILogical control)

Parameters

control ILogical

Returns

INameScope

Find<T>(INameScope, string)

Finds a named element in an INameScope.

public static T? Find<T>(this INameScope nameScope, string name) where T : class

Parameters

nameScope INameScope

The name scope.

name string

The name.

Returns

T

The named element or null if not found.

Type Parameters

T

The element type.

Find<T>(ILogical, string)

Finds a named element in an INameScope.

public static T? Find<T>(this ILogical anchor, string name) where T : class

Parameters

anchor ILogical

The control to take the name scope from.

name string

The name.

Returns

T

The named element or null if not found.

Type Parameters

T

The element type.

Get<T>(INameScope, string)

Gets a named element from an INameScope or throws if no element of the requested name was found.

public static T Get<T>(this INameScope nameScope, string name) where T : class

Parameters

nameScope INameScope

The name scope.

name string

The name.

Returns

T

The named element.

Type Parameters

T

The element type.

Get<T>(ILogical, string)

Gets a named element from an INameScope or throws if no element of the requested name was found.

public static T Get<T>(this ILogical anchor, string name) where T : class

Parameters

anchor ILogical

The control to take the name scope from.

name string

The name.

Returns

T

The named element.

Type Parameters

T

The element type.