Skip to main content

INameScope Interface

Definition​

Assembly:Avalonia.Base
Package:Avalonia

Defines a name scope.

public interface INameScope

Methods​

NameDescription
CompleteMarks the name scope as completed, no further registrations will be allowed
FindFinds a named element in the name scope, returns immediately, doesn't traverse the name scope stack
FindAsyncFinds 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.
RegisterRegisters an element in the name scope.

Complete Method​

Marks the name scope as completed, no further registrations will be allowed

public void Complete()

Find Method​

Finds a named element in the name scope, returns immediately, doesn't traverse the name scope stack

public object Find(string name)

Parameters​

name string

The name.

Returns​

object

The element, or null if the name was not found.

FindAsync Method​

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.

public Avalonia.Utilities.SynchronousCompletionAsyncResult<T><object> FindAsync(string name)

Parameters​

name string

The name.

Returns​

Avalonia.Utilities.SynchronousCompletionAsyncResult<T><object>

The element, or null if the name was not found.

Register Method​

Registers an element in the name scope.

public void Register(string name, object element)

Parameters​

name string

The element name.

element object

The element.

Properties​

NameDescription
IsCompletedReturns whether further registrations are allowed on the scope

IsCompleted Property​

Returns whether further registrations are allowed on the scope

public bool IsCompleted { get; set; }