Class NameScope
Implements a name scope.
public class NameScope : INameScope
- Inheritance
-
NameScope
- Implements
- Inherited Members
- Extension Methods
Constructors
NameScope()
public NameScope()
Fields
NameScopeProperty
Defines the NameScope attached property.
public static readonly AttachedProperty<INameScope> NameScopeProperty
Field Value
Properties
IsCompleted
Returns whether further registrations are allowed on the scope
public bool IsCompleted { get; }
Property Value
Methods
Complete()
Marks the name scope as completed, no further registrations will be allowed
public void Complete()
Find(string)
Finds a named element in the name scope, returns immediately, doesn't traverse the name scope stack
public object? Find(string name)
Parameters
name
stringThe name.
Returns
- object
The element, or null if the name was not found.
FindAsync(string)
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 SynchronousCompletionAsyncResult<object?> FindAsync(string name)
Parameters
name
stringThe name.
Returns
- SynchronousCompletionAsyncResult<object>
The element, or null if the name was not found.
GetNameScope(StyledElement)
Gets the value of the attached NameScopeProperty on a styled element.
public static INameScope GetNameScope(StyledElement styled)
Parameters
styled
StyledElementThe styled element.
Returns
- INameScope
The value of the NameScope attached property.
Register(string, object)
Registers an element in the name scope.
public void Register(string name, object element)
Parameters
SetNameScope(StyledElement, INameScope)
Sets the value of the attached NameScopeProperty on a styled element.
public static void SetNameScope(StyledElement styled, INameScope value)
Parameters
styled
StyledElementThe styled element.
value
INameScopeThe value to set.