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
7| Name | Type | Description |
|---|---|---|
BeginSession(ConsoleLiveDisplayContext, ConsoleViewResult, CancellationToken)() | FocusSession | Begins a new focus session that tracks updates on the provided live display context. |
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 retried on the next snapshot update only. |
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. |