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
controlIWindowControlThe 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
controlIFocusableControlThe control whose focus changed
hasFocusboolWhether the control now has focus