Skip to main content

NameScope Class

Definition​

Assembly:Avalonia.Base
Package:Avalonia

Implements a name scope.

public class NameScope

Inheritance: object -> NameScope

Implements:INameScope

Constructors​

NameDescription
NameScopeNo summary available.

NameScope Constructor​

public NameScope()

Methods​

NameDescription
CompleteNo summary available.
FindFinds a named element in the name scope, returns immediately, doesn't traverse the name scope stack
FindAsyncNo summary available.
GetNameScopeGets the value of the attached Avalonia.Controls.NameScope.NameScopeProperty on a styled element.
RegisterRegisters an element in the name scope.
SetNameScopeSets the value of the attached Avalonia.Controls.NameScope.NameScopeProperty on a styled element.

Complete Method​

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​

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

Parameters​

name string

Returns​

Avalonia.Utilities.SynchronousCompletionAsyncResult<T><object>

GetNameScope Method​

Gets the value of the attached Avalonia.Controls.NameScope.NameScopeProperty on a styled element.

public Avalonia.Controls.INameScope GetNameScope(Avalonia.StyledElement styled)

Parameters​

styled Avalonia.StyledElement

The styled element.

Returns​

Avalonia.Controls.INameScope

The value of the NameScope attached property.

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.

SetNameScope Method​

Sets the value of the attached Avalonia.Controls.NameScope.NameScopeProperty on a styled element.

public void SetNameScope(Avalonia.StyledElement styled, Avalonia.Controls.INameScope value)

Parameters​

styled Avalonia.StyledElement

The styled element.

value Avalonia.Controls.INameScope

The value to set.

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; }

Fields​

NameDescription
NameScopePropertyDefines the NameScope attached property.

NameScopeProperty Field​

Defines the NameScope attached property.

public Avalonia.AttachedProperty<TValue><Avalonia.Controls.INameScope> NameScopeProperty