INameScope Interface
Definition
Defines a name scope.
public interface INameScope
Methods
| Name | Description |
|---|---|
| Complete | Marks the name scope as completed, no further registrations will be allowed |
| Find | Finds a named element in the name scope, returns immediately, doesn't traverse the name scope stack |
| FindAsync | 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 | Registers 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
| Name | Description |
|---|---|
| IsCompleted | Returns whether further registrations are allowed on the scope |
IsCompleted Property
Returns whether further registrations are allowed on the scope
public bool IsCompleted { get; set; }