Interface IFocusScope
- Namespace
- BSGameLib.UI
- Assembly
- BSGameLib.UI.dll
A control holding interactive controls that a walk of the view's own tree cannot reach.
public interface IFocusScope
Remarks
Implemented by Repeater, whose generated rows are deliberately kept
out of RootLayout: rows share the item template's control ids, so a
tree walk for GetControl("name") would find an arbitrary one of N. Keeping them out
also kept them out of the view's focus ring, which is what this interface exists to undo -
a scope is asked for its controls separately, so they can take input without joining the
tree that resolves ids and view-level bindings.
A scope's controls are collected immediately *before* the scope control itself, so a click landing on a button inside a row reaches that button rather than being captured by the list that owns the row - BSGameLib.UI.UIRoot routes a press to the first hovered control it finds.
Return only controls that are currently arranged and visible; a scrolled-away row's controls still have stale bounds from wherever they last laid out, and would take clicks meant for whatever is drawn there now. Call InvalidateFocusables() whenever the answer changes.
Methods
GetFocusables()
The controls in this scope that can take focus, in focus order. Only visible, arranged controls are returned.
IEnumerable<InteractiveControl> GetFocusables()