INameScope Interface

Summary

Defines a name scope.
Namespace
Avalonia.Controls
Implementing Types
graph BT Type["INameScope"] class Type type-node Implementing0["NameScope"]-.->Type click Implementing0 "/api/Avalonia.Controls/NameScope" Implementing1["ChildNameScope"]-.->Type click Implementing1 "/api/Avalonia.Controls/ChildNameScope"

Syntax

public interface INameScope

Properties

Name Value Summary
IsCompleted bool
Returns whether further registrations are allowed on the scope

Methods

Name Value Summary
Complete() void
Marks the name scope as completed, no further registrations will be allowed
Find(string) object
Finds a named element in the name scope, returns immediately, doesn't traverse the name scope stack
FindAsync(string) SynchronousCompletionAsyncResult<object>
Finds a named element in the name scope, waits for the scope to be completely populated before returning null Returned task is configured to run any continuations synchronously.
Register(string, object) void
Registers an element in the name scope.

Extension Methods

Name Value Summary
Find<T>(string) T
Finds a named element in an INameScope.
Get<T>(string) T
Gets a named element from an INameScope or throws if no element of the requested name was found.