FocusManager
ClassTracks focusable elements within the current virtual DOM and coordinates focus changes.
Namespace:
RazorConsole.Core.FocusAssembly:
RazorConsole.CoreDefinition
public sealed class FocusManager : IObserver<ConsoleRenderer.RenderSnapshot>Constructors
1| Name | Type | Description |
|---|---|---|
FocusManager() | Constructor | — |
Properties
2Methods
6| Name | Type | Description |
|---|---|---|
FocusAsync(string, CancellationToken)() | Task<Boolean> | Attempts to focus the target that matches the supplied key. If the target does not exist in the current snapshot, the request is stored and applied when a later snapshot contains it, unless focus is moved explicitly first. |
FocusNextAsync(CancellationToken)() | Task<Boolean> | Moves focus to the next focusable target in traversal order. |
FocusPreviousAsync(CancellationToken)() | Task<Boolean> | Moves focus to the previous focusable target in traversal order. |
IsFocused(string?)() | Boolean | Determines whether the supplied focus key corresponds to the active focus target. |
OnCompleted() | Method | — |
OnError(Exception)() | Method | — |
Events
1| Name | Type | Description |
|---|---|---|
FocusChanged | EventHandler<FocusChangedEventArgs> | Raised when the focused element changes. |