NameScope Class

Summary

Implements a name scope.
Namespace
Avalonia.Controls
Interfaces
Base Types
  • object
graph TD Base0["object"]-->Type Interface0["INameScope"]-.->Type click Interface0 "/api/Avalonia.Controls/INameScope" Type["NameScope"] class Type type-node

Syntax

public class NameScope : INameScope

Events

Name Type Summary
Registered EventHandler<NameScopeEventArgs>
Raised when an element is registered with the name scope.
Unregistered EventHandler<NameScopeEventArgs>
Raised when an element is unregistered with the name scope.

Fields

Name Constant Value Summary
NameScopeProperty
Defines the NameScope attached property.
static

Methods

Name Value Summary
Find(string) object
Finds a named element in the name scope.
FindNameScope(StyledElement) INameScope
Finds the containing name scope for a styled element.
static
GetNameScope(StyledElement) INameScope
Gets the value of the attached NameScopeProperty on a styled element.
static
Register(string, object) void
Registers an element with the name scope.
SetNameScope(StyledElement, INameScope) void
Sets the value of the attached NameScopeProperty on a styled element.
static
Unregister(string) void
Unregisters an element with 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.