WindowManager
Namespace: Hex1b
Assembly: Hex1b.dll
Manages floating windows within a . Handles window registration, z-ordering, and modal window stacking.
public sealed class WindowManagerInheritance
Object → WindowManager
Properties
ActiveWindow
Gets the currently active (topmost non-modal or topmost modal) window.
Returns: WindowEntry
public WindowEntry? ActiveWindow { get; }All
Gets all open windows in z-order (bottom to top).
Returns: IReadOnlyList<WindowEntry>
public IReadOnlyList<WindowEntry> All { get; }Count
Gets the count of open windows.
Returns: Int32
public int Count { get; }HasModalWindow
Checks if there are any modal windows open. When modal windows are open, non-modal windows should not receive input.
Returns: Boolean
public bool HasModalWindow { get; }Methods
BringToFront(WindowEntry)
Brings a window to the front (highest z-index).
Parameters:
entry(WindowEntry): The window to bring to front.
public void BringToFront(WindowEntry entry)BringToFront(WindowHandle)
Brings a window to the front by its handle.
Parameters:
handle(WindowHandle): The window handle.
public void BringToFront(WindowHandle handle)Close(WindowEntry)
Closes a window by its entry.
Parameters:
entry(WindowEntry): The window entry to close.
Returns: Boolean
True if the window was found and closed.
public bool Close(WindowEntry entry)Close(WindowHandle)
Closes a window by its handle.
Parameters:
handle(WindowHandle): The window handle.
Returns: Boolean
True if the window was found and closed.
public bool Close(WindowHandle handle)CloseAll()
Closes all windows.
public void CloseAll()Get(WindowHandle)
Gets a window entry by its handle.
Parameters:
handle(WindowHandle): The window handle.
Returns: WindowEntry
The window entry, or null if not found.
public WindowEntry? Get(WindowHandle handle)IsOpen(WindowHandle)
Checks if a window with the given handle is open.
Parameters:
handle(WindowHandle): The window handle.
Returns: Boolean
True if the window is open.
public bool IsOpen(WindowHandle handle)Open(WindowHandle)
Opens a window from a window handle. If the window is already open, it is brought to front instead.
Parameters:
handle(WindowHandle): The window handle created by .
Returns: WindowEntry
The window entry.
public WindowEntry Open(WindowHandle handle)Window(Func<WindowContentContext<Hex1bWidget>, Hex1bWidget>)
Creates a new window handle with the specified content builder. The window is not opened until is called.
Parameters:
content(Func<Hex1bWidget>, Hex1bWidget>): Builder function for window content. Receives a
that provides access to the window handle via theWindowproperty.
Returns: WindowHandle
A window handle that can be configured with fluent methods and opened.
public WindowHandle Window(Func<WindowContentContext<Hex1bWidget>, Hex1bWidget> content)Events
Changed
Event raised when the window collection or state changes.
Returns: Action
public event Action? ChangedRemarks
The window manager is the central coordinator for all floating windows in an application. It tracks: All open windows and their z-orderThe currently active (focused) windowModal window stack for blocking interaction
Access the window manager from event handlers via e.Context.Windows or through the property.
Examples
Opening a window from a button click:
ctx.Button("Open Settings").OnClick(e => {
var window = e.Windows.Window(w => w.VStack(v => [
v.Text("Settings content here"),
v.Button("Close").OnClick(ev => ev.Windows.Close(w.Window))
]))
.Title("Settings")
.Size(60, 20);
e.Windows.Open(window);
});