Table of Contents

Class Window

Namespace
Xui.Core.Abstract
Assembly
Core.dll

Represents an abstract cross-platform application window in Xui. Handles input, rendering, layout, and software keyboard integration.

public abstract class Window : IWindow, IWindow.ISoftKeyboard
Inheritance
Window
Implements
Inherited Members

Remarks

This class connects the abstract UI framework with the underlying platform window, acting as a root container for layout and visual composition. Subclasses may override specific input or rendering behaviors as needed.

Constructors

Window()

Initializes a new instance of the Window class. This creates the backing platform window.

public Window()

Fields

OpenWindows

Gets a read-only list of all currently open Xui windows.

public static IReadOnlyList<Window> OpenWindows

Field Value

IReadOnlyList<Window>

Properties

Actual

Gets the underlying platform-specific window instance.

public IWindow Actual { get; }

Property Value

IWindow

Content

The root view of the window's content hierarchy.

public virtual View? Content { get; set; }

Property Value

View

DisplayArea

Gets or sets the total visible area of the window, including content that may be obscured by hardware cutouts, rounded corners, or system UI overlays.

public virtual Rect DisplayArea { get; set; }

Property Value

Rect

Remarks

Used by the layout system to determine the full available size.

RequireKeyboard

Requests that the soft keyboard be shown or hidden (on supported platforms).

public bool RequireKeyboard { get; set; }

Property Value

bool

SafeArea

Gets or sets the "safe" area of the window, excluding obstructions like notches or status bars. Important UI elements should be placed within this area.

public virtual Rect SafeArea { get; set; }

Property Value

Rect

Remarks

Especially relevant on mobile devices and in emulator scenarios.

Title

Gets or sets the window title (where supported by the platform).

public string Title { get; set; }

Property Value

string

Methods

Closed()

Invoked when the window is closed and cleanup should occur.

public virtual void Closed()

Closing()

Invoked before the window closes. Returning false can cancel the closure.

public virtual bool Closing()

Returns

bool

true if the window may close; otherwise, false.

CreateActualWindow()

Creates the platform-specific window for this abstract window.

protected virtual IWindow CreateActualWindow()

Returns

IWindow

The platform implementation of IWindow.

DeleteBackwards(ref DeleteBackwardsEventRef)

Requests deletion of content preceding the caret or selection.

public virtual void DeleteBackwards(ref DeleteBackwardsEventRef eventRef)

Parameters

eventRef DeleteBackwardsEventRef

The input event representing a backspace action.

InsertText(ref InsertTextEventRef)

Requests insertion of one or more characters into the current input context.

public virtual void InsertText(ref InsertTextEventRef eventRef)

Parameters

eventRef InsertTextEventRef

The input event containing the text to insert.

Invalidate()

Requests a visual invalidation/redraw of this window.

public virtual void Invalidate()

OnAnimationFrame(ref FrameEventRef)

Invoked once per frame to propagate animation timing information.

public virtual void OnAnimationFrame(ref FrameEventRef e)

Parameters

e FrameEventRef

OnMouseDown(ref MouseDownEventRef)

Invoked when a mouse button is pressed within the window.

public virtual void OnMouseDown(ref MouseDownEventRef e)

Parameters

e MouseDownEventRef

OnMouseMove(ref MouseMoveEventRef)

Invoked when the mouse is moved within the window.

public virtual void OnMouseMove(ref MouseMoveEventRef e)

Parameters

e MouseMoveEventRef

OnMouseUp(ref MouseUpEventRef)

Invoked when a mouse button is released within the window.

public virtual void OnMouseUp(ref MouseUpEventRef e)

Parameters

e MouseUpEventRef

OnScrollWheel(ref ScrollWheelEventRef)

Invoked when the scroll wheel is used within the window.

public virtual void OnScrollWheel(ref ScrollWheelEventRef e)

Parameters

e ScrollWheelEventRef

OnTouch(ref TouchEventRef)

Invoked when touch input occurs within the window.

public virtual void OnTouch(ref TouchEventRef e)

Parameters

e TouchEventRef

Render(ref RenderEventRef)

Invoked during the render phase of the UI lifecycle. Responsible for triggering layout and visual updates.

public virtual void Render(ref RenderEventRef renderEventRef)

Parameters

renderEventRef RenderEventRef

Show()

Makes the window visible and adds it to the list of open windows.

public void Show()

WindowHitTest(ref WindowHitTestEventRef)

Invoked when the system requests a hit test for window interaction. Allows the app to indicate whether a region is draggable, resizable, etc.

public virtual void WindowHitTest(ref WindowHitTestEventRef evRef)

Parameters

evRef WindowHitTestEventRef

The hit test event containing pointer position and window bounds.