Table of Contents

Class WindowControlExtensions

Namespace
SharpConsoleUI.Extensions
Assembly
SharpConsoleUI.dll

Extension methods for IWindowControl.

public static class WindowControlExtensions
Inheritance
WindowControlExtensions
Inherited Members

Methods

GetParentWindow(IWindowControl)

Gets the parent Window by walking up the container hierarchy. Returns null if the control is not attached to a window.

public static Window? GetParentWindow(this IWindowControl control)

Parameters

control IWindowControl

The control to find the parent window for.

Returns

Window

The parent Window, or null if not attached to a window.

NotifyParentWindowOfFocusChange(IFocusableControl, bool)

Notifies the parent Window that this control's focus has changed. Call this after updating HasFocus to keep Window's focus tracking in sync.

public static void NotifyParentWindowOfFocusChange(this IFocusableControl control, bool hasFocus)

Parameters

control IFocusableControl

The control whose focus changed

hasFocus bool

Whether the control now has focus