Table of Contents

Interface IFocusScope

Namespace
SharpConsoleUI.Controls
Assembly
SharpConsoleUI.dll

Implemented by container controls that manage Tab navigation within themselves. Replaces IDirectionalFocusControl and IFocusTrackingContainer.

public interface IFocusScope
Extension Methods

Properties

SavedFocus

Saved focus position. FocusManager sets this before exiting the scope (if scope opts in). GetInitialFocus should return this when set, then clear it.

IFocusableControl? SavedFocus { get; set; }

Property Value

IFocusableControl

Methods

GetInitialFocus(bool)

Returns the first child to focus when Tab enters this scope. backward=true means Shift+Tab entered from the right — return last child.

IFocusableControl? GetInitialFocus(bool backward)

Parameters

backward bool

Returns

IFocusableControl

GetNextFocus(IFocusableControl, bool)

Returns the next child to focus after Tab from 'current'. Returns null when Tab should exit this scope.

IFocusableControl? GetNextFocus(IFocusableControl current, bool backward)

Parameters

current IFocusableControl
backward bool

Returns

IFocusableControl