# Xui.Core.Abstract

Assembly: **Xui.Core** · [C# declarations](index.cs) · [Assembly overview](../index.md)

## Types

- [`class Application`](#api-a5124652657a9031)
- [`class FixedClock`](#api-75a815eb72b44e48)
- [`class HotReload`](#api-e2b9982fd5921797)
- [`interface IClock`](#api-98df95bbe1fca092)
- [`interface IContent`](#api-8940fdd998bce8b1)
- [`interface IMacOSWindowStyle`](#api-ee3c65ac7d25f8de)
- [`interface IRandom`](#api-3666179607cbded8)
- [`interface IWindow`](#api-d6645d5140bbbbed)
- [`interface IWindow.IDesktopStyle`](#api-bf7359e519a7582b)
- [`enum IWindow.IDesktopStyle.DesktopWindowLevel`](#api-d4a43d9cba9a303b)
- [`enum IWindow.IDesktopStyle.WindowBackdrop`](#api-728ebccb1abfa087)
- [`enum IWindow.IDesktopStyle.WindowClientArea`](#api-2d6ee48a245f94d0)
- [`interface IWindow.ISoftKeyboard`](#api-a29d4a67268e8294)
- [`enum MacOSWindowBackground`](#api-3ca505d09f82d33f)
- [`enum MacOSWindowTitle`](#api-2fd5e8bba67daa7e)
- [`enum MacOSWindowTitleHeight`](#api-d22aa18dc3b1df10)
- [`class SeededRandom`](#api-155ca473a63dd442)
- [`class SystemClock`](#api-28cc33502b836146)
- [`class SystemRandom`](#api-6c44bd5616f6c150)
- [`class Window`](#api-ddf8a9ad7329295a)

<a id="api-a5124652657a9031"></a>

## `class Application`

Represents an abstract base class for Xui applications. This class is paired at runtime with a platform-specific counterpart, which delegates to actual system APIs on macOS, Windows, Android, etc. Users should subclass [`Xui.Core.Abstract.Application`](../xui-core-abstract/index.md#api-a5124652657a9031), override the [`Xui.Core.Abstract.Application.Start`](../xui-core-abstract/index.md#api-8decdd2ac09739b8) method, and call [`Xui.Core.Abstract.Application.Run`](../xui-core-abstract/index.md#api-7e95c1e5632a4768) to launch the application.

```csharp
public abstract class Application : IServiceProvider
{
    public IServiceProvider Context { get; }

    public virtual object? GetService(Type serviceType);
    public IRuntime Runtime { get; }
    public List<IDisposable> DisposeQueue { get; }

    public Application(IServiceProvider context);
    public virtual int Run();
    public virtual void Quit();
    public abstract void Start();
    public event Action? Exit;
    public virtual void OnExit();
}
```

<a id="api-bdc7f8c8d2982e20"></a>

### [`Application.Application(IServiceProvider context)`](#api-bdc7f8c8d2982e20)


```csharp
public Application(IServiceProvider context);
```

Initializes a new instance of the [`Xui.Core.Abstract.Application`](../xui-core-abstract/index.md#api-a5124652657a9031) class.

<a id="api-9bd972806681519c"></a>

### [`IServiceProvider Application.Context`](#api-9bd972806681519c)


```csharp
public IServiceProvider Context { get; }
```

The service provider for this application.

<a id="api-bf02c416fc0eb6cd"></a>

### [`List<IDisposable> Application.DisposeQueue`](#api-bf02c416fc0eb6cd)


```csharp
public List<IDisposable> DisposeQueue { get; }
```

A list of disposables that are disposed when the application exits.

<a id="api-2505a21b3bcb6a67"></a>

### [`event Action? Application.Exit`](#api-2505a21b3bcb6a67)


```csharp
public event Action? Exit;
```

Raised when the application exits on platforms with a definite exit point. See [`Xui.Core.Abstract.Application.OnExit`](../xui-core-abstract/index.md#api-34e5fa202f702fc7) for the same constraint on when this fires.

<a id="api-3685541c153d87ad"></a>

### [`object? Application.GetService(Type serviceType)`](#api-3685541c153d87ad)


```csharp
public virtual object? GetService(Type serviceType);
```

Gets the service object of the specified type.

- **`serviceType`** — An object that specifies the type of service object to get.

**Returns:** A service object of type `serviceType`. -or- `null` if there is no service object of type `serviceType`.

<a id="api-34e5fa202f702fc7"></a>

### [`void Application.OnExit()`](#api-34e5fa202f702fc7)


```csharp
public virtual void OnExit();
```

Called by run loops that have a definite exit point (e.g. Win32, macOS) just before their [`Xui.Core.Actual.IRunLoop.Run`](../xui-core-actual/index.md#api-9375af5402526eb8) returns. Not called on platforms whose run loop never exits (iOS, Browser canvas), so do not rely on this for cleanup that must always run.

<a id="api-36d9a2440a3f91db"></a>

### [`void Application.Quit()`](#api-36d9a2440a3f91db)


```csharp
public virtual void Quit();
```

Requests graceful shutdown of the application&#39;s run loop. On platforms without a blocking run loop (iOS, Browser) this is a no-op.

<a id="api-7e95c1e5632a4768"></a>

### [`int Application.Run()`](#api-7e95c1e5632a4768)


```csharp
public virtual int Run();
```

Starts the main application loop by delegating to the platform-specific run loop. This method may block until the application exits, or may return immediately if the platform bootstraps a runtime loop before instantiating the app delegate.

**Returns:** The application’s exit code.

<a id="api-fc3b59195d15e08e"></a>

### [`IRuntime Application.Runtime`](#api-fc3b59195d15e08e)


```csharp
public IRuntime Runtime { get; }
```

The platform runtime used by this application.

<a id="api-8decdd2ac09739b8"></a>

### [`void Application.Start()`](#api-8decdd2ac09739b8)


```csharp
public abstract void Start();
```

Called by the runtime after initialization. Override this method to set up application state and display the initial UI.


<a id="api-75a815eb72b44e48"></a>

## `class FixedClock`

Mutable clock implementation used for deterministic scenarios such as tests.

```csharp
public sealed class FixedClock : IClock
{
    public FixedClock(DateTime now);
    public DateTime Now { get; }

    public void Set(DateTime now);
    public void Advance(TimeSpan delta);
}
```

<a id="api-55f85209b3c060d3"></a>

### [`FixedClock.FixedClock(DateTime now)`](#api-55f85209b3c060d3)


```csharp
public FixedClock(DateTime now);
```

Initializes a new fixed clock with an initial time value.

- **`now`** — The initial local time.

<a id="api-6ef7d54320a31e23"></a>

### [`void FixedClock.Advance(TimeSpan delta)`](#api-6ef7d54320a31e23)


```csharp
public void Advance(TimeSpan delta);
```

Advances the current fixed time by a delta.

- **`delta`** — The time delta to add.

<a id="api-c56da4e6ba83a04a"></a>

### [`DateTime FixedClock.Now`](#api-c56da4e6ba83a04a)


```csharp
public DateTime Now { get; }
```

Gets the current fixed local time.

<a id="api-b48e0dd21e4d6e61"></a>

### [`void FixedClock.Set(DateTime now)`](#api-b48e0dd21e4d6e61)


```csharp
public void Set(DateTime now);
```

Sets the current fixed time.

- **`now`** — The new local time.


<a id="api-e2b9982fd5921797"></a>

## `class HotReload`

Internal integration point for .NET&#39;s MetadataUpdateHandler, enabling partial support for Hot Reload during development. This is not a stable API and should not be used by application developers.

This type is invoked automatically by the runtime when types are updated via Edit and Continue or Hot Reload. However, Hot Reload support in Xui is limited, and application developers should rely on full rebuilds for consistent behavior. The current implementation simply invalidates open windows and clears transient caches, without attempting to rehydrate or diff application state.

```csharp
public static class HotReload
{
    public static event Action? OnReload;
    public static void ClearCache(Type[]? updatedTypes);
    public static void UpdateApplication(Type[]? updatedTypes);
    public static void MainThreadUpdateApplication(Type[]? updatedTypes);
}
```

<a id="api-2f95483628fbdd5f"></a>

### [`void HotReload.ClearCache(Type[]? updatedTypes)`](#api-2f95483628fbdd5f)


```csharp
public static void ClearCache(Type[]? updatedTypes);
```

Called by the runtime to clear any cached data after a hot reload. Not intended for use by application developers.

- **`updatedTypes`** — The list of updated types, if available.

<a id="api-fbecfe736b4bfa6f"></a>

### [`void HotReload.MainThreadUpdateApplication(Type[]? updatedTypes)`](#api-fbecfe736b4bfa6f)


```csharp
public static void MainThreadUpdateApplication(Type[]? updatedTypes);
```

Performs a synchronous application update on the main thread. Invokes the [`Xui.Core.Abstract.HotReload.OnReload`](../xui-core-abstract/index.md#api-a666886b05c4ce92) event so subscribers (windows) can invalidate.

- **`updatedTypes`** — The list of updated types, if available.

<a id="api-a666886b05c4ce92"></a>

### [`event Action? HotReload.OnReload`](#api-a666886b05c4ce92)


```csharp
public static event Action? OnReload;
```

Raised on the UI thread when a hot reload occurs. Windows subscribe to this event to invalidate themselves.

<a id="api-137ebfb1ab683d41"></a>

### [`void HotReload.UpdateApplication(Type[]? updatedTypes)`](#api-137ebfb1ab683d41)


```csharp
public static void UpdateApplication(Type[]? updatedTypes);
```

Posts a request to the main UI dispatcher to refresh application state.

- **`updatedTypes`** — The list of updated types, if available.


<a id="api-98df95bbe1fca092"></a>

## `interface IClock`

Provides access to the current clock time.

```csharp
public interface IClock
{
    DateTime Now { get; }
}
```

<a id="api-a3363bfc55a53429"></a>

### [`DateTime IClock.Now`](#api-a3363bfc55a53429)


```csharp
DateTime Now { get; }
```

Gets the current local time.


<a id="api-8940fdd998bce8b1"></a>

## `interface IContent`

Defines the contract for UI content that participates in layout, rendering, and input dispatch.

```csharp
public partial interface IContent
{
    void Invalidate();
    void OnMouseDown(ref MouseDownEventRef e);
    void OnMouseMove(ref MouseMoveEventRef e);
    void OnMouseUp(ref MouseUpEventRef e);
    void OnScrollWheel(ref ScrollWheelEventRef e);
    void OnZoom(ref ZoomEventRef e);
    void OnTouch(ref TouchEventRef e);
    void OnAnimationFrame(ref FrameEventRef e);
    void Update(ref RenderEventRef @event);
    void OnKeyDown(ref KeyEventRef e);
    void OnChar(ref KeyEventRef e);
}
```

<a id="api-81649c0a51c22758"></a>

### [`void IContent.Invalidate()`](#api-81649c0a51c22758)


```csharp
void Invalidate();
```

Requests a visual redraw of this content.

<a id="api-7edd0fbd46286c19"></a>

### [`void IContent.OnAnimationFrame(ref FrameEventRef e)`](#api-7edd0fbd46286c19)


```csharp
void OnAnimationFrame(ref FrameEventRef e);
```

Invoked on each animation frame tick.

<a id="api-ac3ae942095a04ca"></a>

### [`void IContent.OnChar(ref KeyEventRef e)`](#api-ac3ae942095a04ca)


```csharp
void OnChar(ref KeyEventRef e);
```

Invoked when a character is typed.

<a id="api-3b61817d24f95c5c"></a>

### [`void IContent.OnKeyDown(ref KeyEventRef e)`](#api-3b61817d24f95c5c)


```csharp
void OnKeyDown(ref KeyEventRef e);
```

Invoked when a keyboard key is pressed.

<a id="api-6ee014fbddc35bfd"></a>

### [`void IContent.OnMouseDown(ref MouseDownEventRef e)`](#api-6ee014fbddc35bfd)


```csharp
void OnMouseDown(ref MouseDownEventRef e);
```

Invoked when a mouse button is pressed within this content&#39;s area.

<a id="api-076591727dbdbf39"></a>

### [`void IContent.OnMouseMove(ref MouseMoveEventRef e)`](#api-076591727dbdbf39)


```csharp
void OnMouseMove(ref MouseMoveEventRef e);
```

Invoked when the mouse pointer moves within this content&#39;s area.

<a id="api-d5f8428d590c3d67"></a>

### [`void IContent.OnMouseUp(ref MouseUpEventRef e)`](#api-d5f8428d590c3d67)


```csharp
void OnMouseUp(ref MouseUpEventRef e);
```

Invoked when a mouse button is released.

<a id="api-6f15c41f386f8e89"></a>

### [`void IContent.OnScrollWheel(ref ScrollWheelEventRef e)`](#api-6f15c41f386f8e89)


```csharp
void OnScrollWheel(ref ScrollWheelEventRef e);
```

Invoked when the scroll wheel is used over this content.

<a id="api-8d808ade4689610f"></a>

### [`void IContent.OnTouch(ref TouchEventRef e)`](#api-8d808ade4689610f)


```csharp
void OnTouch(ref TouchEventRef e);
```

Invoked when a touch event occurs.

<a id="api-bc427d02c1e47b69"></a>

### [`void IContent.OnZoom(ref ZoomEventRef e)`](#api-bc427d02c1e47b69)


```csharp
void OnZoom(ref ZoomEventRef e);
```

Invoked when a platform magnification gesture occurs over this content.

<a id="api-648ace1c44213395"></a>

### [`void IContent.Update(ref RenderEventRef @event)`](#api-648ace1c44213395)


```csharp
void Update(ref RenderEventRef @event);
```

Performs layout and renders this content into [`Xui.Core.Abstract.Events.RenderEventRef.Context`](../xui-core-abstract-events/index.md#api-91e5ac8b2b3fe256).


<a id="api-ee3c65ac7d25f8de"></a>

## `interface IMacOSWindowStyle`

Describes the macOS-specific chrome treatment for a desktop window. Implementing this interface is safe on every target; non-macOS runtimes ignore it.

```csharp
public interface IMacOSWindowStyle
{
    public MacOSWindowTitle Title { get; }
    public MacOSWindowTitleHeight TitleHeight { get; }
    public MacOSWindowBackground Background { get; }
}
```

<a id="api-51fa135726211448"></a>

### [`MacOSWindowBackground IMacOSWindowStyle.Background`](#api-51fa135726211448)


```csharp
public MacOSWindowBackground Background { get; }
```

Selects the window background treatment.

<a id="api-6cc646fe81ba8712"></a>

### [`MacOSWindowTitle IMacOSWindowStyle.Title`](#api-6cc646fe81ba8712)


```csharp
public MacOSWindowTitle Title { get; }
```

Controls whether AppKit displays the native window title.

<a id="api-8121bd7f88933d76"></a>

### [`MacOSWindowTitleHeight IMacOSWindowStyle.TitleHeight`](#api-8121bd7f88933d76)


```csharp
public MacOSWindowTitleHeight TitleHeight { get; }
```

Selects the native title and toolbar height.


<a id="api-3666179607cbded8"></a>

## `interface IRandom`

Provides random value generation.

```csharp
public interface IRandom
{
    int Next(int minValue, int maxValue);
    double NextDouble();
}
```

<a id="api-07e53c457b06aec0"></a>

### [`int IRandom.Next(int minValue, int maxValue)`](#api-07e53c457b06aec0)


```csharp
int Next(int minValue, int maxValue);
```

Returns a random integer within the specified range.

- **`minValue`** — Inclusive lower bound of the random number.

- **`maxValue`** — Exclusive upper bound of the random number.

**Returns:** A random integer in the specified range.

<a id="api-35f8d4d4616d9ff7"></a>

### [`double IRandom.NextDouble()`](#api-35f8d4d4616d9ff7)


```csharp
double NextDouble();
```

Returns a random floating-point number in the range [0.0, 1.0).

**Returns:** A random floating-point number.


<a id="api-d6645d5140bbbbed"></a>

## `interface IWindow`

Defines the abstract interface for a platform window in Xui. This surface hosts rendering, input handling, and layout updates.

Implementations of this interface bridge platform-specific `Actual` windowing with the framework’s abstract layer. It is used both for physical windows (e.g. desktop apps) and virtual windows (e.g. emulator windows).

```csharp
public partial interface IWindow
{
    public partial interface IDesktopStyle
    {
        public enum WindowBackdrop
        {
            Default = 0,
            Chromeless = 1,
            Mica = 2,
            Acrylic = 3,
        }
    }
}
public partial interface IWindow
{
    public partial interface IDesktopStyle
    {
        public enum WindowClientArea
        {
            Default,
            Extended,
        }
    }
}
public partial interface IWindow
{
    public partial interface IDesktopStyle
    {
        public enum DesktopWindowLevel : int
        {
            Normal = 0,
            Floating = 100,
            StatusBar = 200,
            Modal = 300,
        }
    }
}
public partial interface IWindow
{
    public partial interface IDesktopStyle
    {
        public WindowBackdrop Backdrop { get; }
        public Size? StartupSize { get; }
        public DesktopWindowLevel Level { get; }
        public bool MacOSDoubleTapSoftwareMaximize { get; }
        public WindowClientArea ClientArea { get; }
    }
}
public partial interface IWindow
{
    public interface ISoftKeyboard
    {
        bool HasText { get; }

        bool IsSecureTextEntry { get; }

        public void InsertText(ref InsertTextEventRef eventRef);
        public void DeleteBackwards(ref DeleteBackwardsEventRef eventRef);
    }
}
public partial interface IWindow
{
    Actual.IWindow? Actual { get; }
    public Rect DisplayArea { get; set; }
    public Rect SafeArea { get; set; }
    public nfloat ScreenCornerRadius { get; set; }

    void Closed();
    bool Closing();
    void OnAnimationFrame(ref FrameEventRef animationFrame);
    void OnMouseMove(ref MouseMoveEventRef evRef);
    void OnMouseDown(ref MouseDownEventRef evRef);
    void OnMouseUp(ref MouseUpEventRef evRef);
    void OnScrollWheel(ref ScrollWheelEventRef evRef);
    void OnZoom(ref ZoomEventRef evRef);
    void OnTouch(ref TouchEventRef touchEventRef);
    void Render(ref RenderEventRef render);
    void WindowHitTest(ref WindowHitTestEventRef evRef);
    void OnKeyDown(ref KeyEventRef e);
    void OnChar(ref KeyEventRef e);
}
```

<a id="api-e79441785c67329c"></a>

### [`IWindow? IWindow.Actual`](#api-e79441785c67329c)


```csharp
Actual.IWindow? Actual { get; }
```

Gets the actual window immediately downstream of this abstract window. Together with [`Xui.Core.Actual.IWindow.Abstract`](../xui-core-actual/index.md#api-a0c698de31f61420), this forms the bidirectional composed-window chain.

<a id="api-fdf811815f6c3d35"></a>

### [`void IWindow.Closed()`](#api-fdf811815f6c3d35)


```csharp
void Closed();
```

Invoked when the window is closed and cleanup should occur.

<a id="api-d3d6bfcbb578fdf7"></a>

### [`bool IWindow.Closing()`](#api-d3d6bfcbb578fdf7)


```csharp
bool Closing();
```

Invoked before the window closes. Returning `false` can cancel the closure.

**Returns:** `true` if the window may close; otherwise, `false`.

<a id="api-de2242de01dbf39e"></a>

### [`Rect IWindow.DisplayArea`](#api-de2242de01dbf39e)


```csharp
public Rect DisplayArea { get; set; }
```

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.

Used by the layout system to determine the full available size.

<a id="api-f36bd059fbaacec3"></a>

### [`void IWindow.OnAnimationFrame(ref FrameEventRef animationFrame)`](#api-f36bd059fbaacec3)


```csharp
void OnAnimationFrame(ref FrameEventRef animationFrame);
```

Invoked once per frame to propagate animation timing information.

- **`animationFrame`** — Timing details for the current animation frame.

<a id="api-f12b1fa82c137a03"></a>

### [`void IWindow.OnChar(ref KeyEventRef e)`](#api-f12b1fa82c137a03)


```csharp
void OnChar(ref KeyEventRef e);
```

Invoked when a character is input (after keyboard translation).

- **`e`** — The keyboard event data with the translated character.

<a id="api-201f9f35a7b62ef9"></a>

### [`void IWindow.OnKeyDown(ref KeyEventRef e)`](#api-201f9f35a7b62ef9)


```csharp
void OnKeyDown(ref KeyEventRef e);
```

Invoked when a key is pressed.

- **`e`** — The keyboard event data.

<a id="api-a58feec1f0284adc"></a>

### [`void IWindow.OnMouseDown(ref MouseDownEventRef evRef)`](#api-a58feec1f0284adc)


```csharp
void OnMouseDown(ref MouseDownEventRef evRef);
```

Invoked when a mouse button is pressed within the window.

- **`evRef`** — The mouse down event data.

<a id="api-ba00e2c62c2cce83"></a>

### [`void IWindow.OnMouseMove(ref MouseMoveEventRef evRef)`](#api-ba00e2c62c2cce83)


```csharp
void OnMouseMove(ref MouseMoveEventRef evRef);
```

Invoked when the mouse is moved within the window.

- **`evRef`** — The mouse movement event data.

<a id="api-9fd4abb8c5657545"></a>

### [`void IWindow.OnMouseUp(ref MouseUpEventRef evRef)`](#api-9fd4abb8c5657545)


```csharp
void OnMouseUp(ref MouseUpEventRef evRef);
```

Invoked when a mouse button is released within the window.

- **`evRef`** — The mouse up event data.

<a id="api-f1e716ce0cd6128d"></a>

### [`void IWindow.OnScrollWheel(ref ScrollWheelEventRef evRef)`](#api-f1e716ce0cd6128d)


```csharp
void OnScrollWheel(ref ScrollWheelEventRef evRef);
```

Invoked when the scroll wheel is used within the window.

- **`evRef`** — The scroll wheel event data.

<a id="api-fe655860fabfca83"></a>

### [`void IWindow.OnTouch(ref TouchEventRef touchEventRef)`](#api-fe655860fabfca83)


```csharp
void OnTouch(ref TouchEventRef touchEventRef);
```

Invoked when touch input occurs within the window.

- **`touchEventRef`** — The touch event data.

<a id="api-4058d8286ec9a212"></a>

### [`void IWindow.OnZoom(ref ZoomEventRef evRef)`](#api-4058d8286ec9a212)


```csharp
void OnZoom(ref ZoomEventRef evRef);
```

Invoked when a platform magnification gesture occurs within the window.

<a id="api-dc0a5719bc9002b1"></a>

### [`void IWindow.Render(ref RenderEventRef render)`](#api-dc0a5719bc9002b1)


```csharp
void Render(ref RenderEventRef render);
```

Invoked during the render phase of the UI lifecycle. Responsible for triggering layout and visual updates.

- **`render`** — The render event data, including target rect and frame info.

<a id="api-7d15b0c30ad625b7"></a>

### [`Rect IWindow.SafeArea`](#api-7d15b0c30ad625b7)


```csharp
public Rect SafeArea { get; set; }
```

Gets or sets the &quot;safe&quot; area of the window, excluding obstructions like notches or status bars. Important UI elements should be placed within this area.

Especially relevant on mobile devices and in emulator scenarios.

<a id="api-80790a1891e250a3"></a>

### [`NFloat IWindow.ScreenCornerRadius`](#api-80790a1891e250a3)


```csharp
public nfloat ScreenCornerRadius { get; set; }
```

Gets or sets the corner radius of the physical screen, in logical pixels. Used to offset UI elements (such as scrollbar indicators) away from rounded screen edges. Zero on desktop platforms where the window has sharp corners.

<a id="api-7e1f522737cbb6e8"></a>

### [`void IWindow.WindowHitTest(ref WindowHitTestEventRef evRef)`](#api-7e1f522737cbb6e8)


```csharp
void WindowHitTest(ref WindowHitTestEventRef evRef);
```

Invoked when the system requests a hit test for window interaction. Allows the app to indicate whether a region is draggable, resizable, etc.

- **`evRef`** — The hit test event containing pointer position and window bounds.


<a id="api-bf7359e519a7582b"></a>

## `interface IWindow.IDesktopStyle`

Provides optional desktop-specific window styling hints for platforms that support multiple top-level windows (e.g., Windows, macOS, Linux).

On mobile platforms, applications typically run in a single full-screen window, and this interface has no effect. On desktop, implementing this interface allows apps to influence window chrome, border visibility, and initial sizing.

```csharp
public partial interface IDesktopStyle
{
    public enum WindowBackdrop
    {
        Default = 0,
        Chromeless = 1,
        Mica = 2,
        Acrylic = 3,
    }
}
public partial interface IDesktopStyle
{
    public enum WindowClientArea
    {
        Default,
        Extended,
    }
}
public partial interface IDesktopStyle
{
    public enum DesktopWindowLevel : int
    {
        Normal = 0,
        Floating = 100,
        StatusBar = 200,
        Modal = 300,
    }
}
public partial interface IDesktopStyle
{
    public WindowBackdrop Backdrop { get; }
    public Size? StartupSize { get; }
    public DesktopWindowLevel Level { get; }
    public bool MacOSDoubleTapSoftwareMaximize { get; }
    public WindowClientArea ClientArea { get; }
}
```

<a id="api-7ff094f1b156b88a"></a>

### [`WindowBackdrop IDesktopStyle.Backdrop`](#api-7ff094f1b156b88a)


```csharp
public WindowBackdrop Backdrop { get; }
```

Controls the window backdrop and chrome style.

<a id="api-5692cad89ea3d9b2"></a>

### [`WindowClientArea IDesktopStyle.ClientArea`](#api-5692cad89ea3d9b2)


```csharp
public WindowClientArea ClientArea { get; }
```

Controls whether the client area includes the title bar region.

**Default**: System-managed non-client area (title bar + borders behave normally).

**Extended**: Extends the client area into the title bar region so the app can draw its own title bar content/background while still allowing native window behaviors via hit testing.



**Windows**: Uses `DwmExtendFrameIntoClientArea` (and relies on `WM_NCHITTEST` returning `HTCAPTION` for draggable regions). This is the recommended way to hide title text/icon reliably, especially with Mica/Acrylic backdrops.

**macOS**: Uses full-size content view / transparent title bar with title visibility hidden.

<a id="api-1e3c1ab776b2b516"></a>

### [`DesktopWindowLevel IDesktopStyle.Level`](#api-1e3c1ab776b2b516)


```csharp
public DesktopWindowLevel Level { get; }
```

Controls the window stacking level (Z-order) relative to other windows.

<a id="api-b5ea3462b08fb88f"></a>

### [`bool IDesktopStyle.MacOSDoubleTapSoftwareMaximize`](#api-b5ea3462b08fb88f)


```csharp
public bool MacOSDoubleTapSoftwareMaximize { get; }
```

Enables AppKit zoom when Xui receives a double-click in a region that [`Xui.Core.Abstract.IWindow.WindowHitTest(Xui.Core.Abstract.Events.WindowHitTestEventRef@)`](../xui-core-abstract/index.md#api-7e1f522737cbb6e8) reports as `Title`. Use this for extended client areas, where the native title bar is not handling the double-click itself. This setting applies only on macOS.

<a id="api-71f2cb9a67b31c4c"></a>

### [`Size? IDesktopStyle.StartupSize`](#api-71f2cb9a67b31c4c)


```csharp
public Size? StartupSize { get; }
```

Optional startup size hint for the window. If `null`, the platform will decide the initial size.


<a id="api-d4a43d9cba9a303b"></a>

## `enum IWindow.IDesktopStyle.DesktopWindowLevel`

Cross-platform window stacking level (Z-order abstraction).

**macOS**: Maps to `NSWindow.Level` values such as `.normal`, `.floating`, `.statusBar`, and `.modalPanel`.



**Windows**: Maps primarily to Win32 Z-order using `HWND_TOPMOST` / `HWND_NOTOPMOST`. Higher levels may be approximated, as Windows exposes fewer public layering tiers than macOS.

```csharp
public enum DesktopWindowLevel : int
{
    Normal = 0,
    Floating = 100,
    StatusBar = 200,
    Modal = 300,
}
```

<a id="api-bc2ddd6805367d50"></a>

### [`DesktopWindowLevel.Floating`](#api-bc2ddd6805367d50)


```csharp
Floating = 100
```

Floating utility window above normal windows.

macOS: `NSWindow.Level.floating`.

 Windows: implemented via `HWND_TOPMOST`.

<a id="api-9581ecd2226555d5"></a>

### [`DesktopWindowLevel.Modal`](#api-9581ecd2226555d5)


```csharp
Modal = 300
```

Modal dialog level that blocks interaction with other app windows.

macOS: `NSWindow.Level.modalPanel` or sheets.

 Windows: enforced via window ownership and modality, not a unique Z-order tier.

<a id="api-ee01963eacc89b23"></a>

### [`DesktopWindowLevel.Normal`](#api-ee01963eacc89b23)


```csharp
Normal = 0
```

Standard application window.

macOS: `NSWindow.Level.normal`.

 Windows: normal (non-topmost) window.

<a id="api-b00dab5c21b03fea"></a>

### [`DesktopWindowLevel.StatusBar`](#api-b00dab5c21b03fea)


```csharp
StatusBar = 200
```

High-floating level for small status or utility UI.

macOS: `NSWindow.Level.statusBar`.

 Windows: approximated as topmost, often with utility window styles.


<a id="api-728ebccb1abfa087"></a>

## `enum IWindow.IDesktopStyle.WindowBackdrop`

Controls the window backdrop and chrome style.

**Windows**: `Default` creates a standard `WS_TILEDWINDOW`. `Chromeless` uses `WS_POPUP` with no system chrome. `Mica` and `Acrylic` use DWM system backdrop APIs (Windows 11+) with system caption buttons but no icon or title text.



**macOS**: `Chromeless` maps to `FullSizeContentView | Borderless` with a transparent title bar and empty toolbar (traffic-light buttons remain, no chrome visible). `Acrylic` uses `NSVisualEffectView` with the same transparent-titlebar + empty-toolbar treatment. `Mica` falls back to this Acrylic treatment because macOS has no native Mica material.

```csharp
public enum WindowBackdrop
{
    Default = 0,
    Chromeless = 1,
    Mica = 2,
    Acrylic = 3,
}
```

<a id="api-4dca968a01507c1c"></a>

### [`WindowBackdrop.Acrylic`](#api-4dca968a01507c1c)


```csharp
Acrylic = 3
```

Blur-behind backdrop. On Windows 11 uses the Acrylic DWM material (more translucent than Mica). On macOS uses `NSVisualEffectView` with a transparent title bar and empty toolbar so traffic-light buttons are visible without any other chrome.

<a id="api-678e57ed86b84bcd"></a>

### [`WindowBackdrop.Chromeless`](#api-678e57ed86b84bcd)


```csharp
Chromeless = 1
```

No system chrome. The entire surface is client area and the app draws everything.

<a id="api-ac1e8a1e8b5f53ee"></a>

### [`WindowBackdrop.Default`](#api-ac1e8a1e8b5f53ee)


```csharp
Default = 0
```

Standard opaque window with full system chrome (title bar, icon, buttons).

<a id="api-7e9f4fe721995db3"></a>

### [`WindowBackdrop.Mica`](#api-7e9f4fe721995db3)


```csharp
Mica = 2
```

Translucent blurred backdrop using the Windows 11 Mica material. System caption buttons are kept, but icon and title text are removed. On macOS this falls back to the same visual-effect treatment as [`Xui.Core.Abstract.IWindow.IDesktopStyle.WindowBackdrop.Acrylic`](../xui-core-abstract/index.md#api-4dca968a01507c1c), because macOS has no native Mica material.


<a id="api-2d6ee48a245f94d0"></a>

## `enum IWindow.IDesktopStyle.WindowClientArea`

Controls how much of the window area is available for application drawing.

```csharp
public enum WindowClientArea
{
    Default,
    Extended,
}
```

<a id="api-43990097f42873b3"></a>

### [`WindowClientArea.Default`](#api-43990097f42873b3)


```csharp
Default
```

System-managed non-client area (title bar + borders behave normally).

<a id="api-33e1146a3fb0debb"></a>

### [`WindowClientArea.Extended`](#api-33e1146a3fb0debb)


```csharp
Extended
```

Extend the client area into the title bar region (app draws background/title area).


<a id="api-a29d4a67268e8294"></a>

## `interface IWindow.ISoftKeyboard`

Represents a handler for software keyboard input.

This interface allows focused views to receive input from the system&#39;s software keyboard, typically used on mobile platforms and the emulator. It handles character insertion and backward deletion commands. This is not meant to expose full IME or keyboard layout logic—just basic input dispatch.

```csharp
public interface ISoftKeyboard
{
    bool HasText { get; }

    bool IsSecureTextEntry { get; }

    public void InsertText(ref InsertTextEventRef eventRef);
    public void DeleteBackwards(ref DeleteBackwardsEventRef eventRef);
}
```

<a id="api-17c559a38dc4fc88"></a>

### [`void ISoftKeyboard.DeleteBackwards(ref DeleteBackwardsEventRef eventRef)`](#api-17c559a38dc4fc88)


```csharp
public void DeleteBackwards(ref DeleteBackwardsEventRef eventRef);
```

Requests deletion of content preceding the caret or selection.

- **`eventRef`** — The input event representing a backspace action.

<a id="api-001a670fc41eac80"></a>

### [`bool ISoftKeyboard.HasText`](#api-001a670fc41eac80)


```csharp
bool HasText { get; }
```

Whether the focused text client contains text.

<a id="api-e68800fad6965861"></a>

### [`void ISoftKeyboard.InsertText(ref InsertTextEventRef eventRef)`](#api-e68800fad6965861)


```csharp
public void InsertText(ref InsertTextEventRef eventRef);
```

Requests insertion of one or more characters into the current input context.

- **`eventRef`** — The input event containing the text to insert.

<a id="api-2ea4b87b9c3fb086"></a>

### [`bool ISoftKeyboard.IsSecureTextEntry`](#api-2ea4b87b9c3fb086)


```csharp
bool IsSecureTextEntry { get; }
```

Whether the focused text client requires password entry.


<a id="api-3ca505d09f82d33f"></a>

## `enum MacOSWindowBackground`

The native macOS window background treatment.

```csharp
public enum MacOSWindowBackground
{
    Default,
    Acrylic,
    Glass,
    Transparent,
    Borderless,
}
```

<a id="api-6dc6c640eec168ea"></a>

### [`MacOSWindowBackground.Acrylic`](#api-6dc6c640eec168ea)


```csharp
Acrylic
```

The standard Acrylic background material.

<a id="api-c4d696db2a33995b"></a>

### [`MacOSWindowBackground.Borderless`](#api-c4d696db2a33995b)


```csharp
Borderless
```

A transparent, application-drawn window surface intended for custom tools and widgets. The application provides its own drag and resize hit testing.

<a id="api-5a0e235501030f8d"></a>

### [`MacOSWindowBackground.Default`](#api-5a0e235501030f8d)


```csharp
Default
```

The standard opaque AppKit window background.

<a id="api-cd924425924ceb11"></a>

### [`MacOSWindowBackground.Glass`](#api-cd924425924ceb11)


```csharp
Glass
```

The dynamic macOS glass material. On macOS releases that do not provide it, this falls back to the Acrylic background material.

<a id="api-27bb003967af6e0b"></a>

### [`MacOSWindowBackground.Transparent`](#api-27bb003967af6e0b)


```csharp
Transparent
```

A transparent borderless window background. The native title is hidden when this background is selected.


<a id="api-2fd5e8bba67daa7e"></a>

## `enum MacOSWindowTitle`

The visibility of the native macOS window title.

```csharp
public enum MacOSWindowTitle
{
    Visible,
    Hidden,
}
```

<a id="api-0121e4b7ab487fc7"></a>

### [`MacOSWindowTitle.Hidden`](#api-0121e4b7ab487fc7)


```csharp
Hidden
```

The native title is hidden.

<a id="api-d726c4b4f0e251f6"></a>

### [`MacOSWindowTitle.Visible`](#api-d726c4b4f0e251f6)


```csharp
Visible
```

The native title is visible.


<a id="api-d22aa18dc3b1df10"></a>

## `enum MacOSWindowTitleHeight`

The native macOS title and toolbar height.

```csharp
public enum MacOSWindowTitleHeight
{
    Default,
    Medium,
    Large,
}
```

<a id="api-b92340e3d15a0b1e"></a>

### [`MacOSWindowTitleHeight.Default`](#api-b92340e3d15a0b1e)


```csharp
Default
```

The standard AppKit title-bar height.

<a id="api-5d5686414bd38bac"></a>

### [`MacOSWindowTitleHeight.Large`](#api-5d5686414bd38bac)


```csharp
Large
```

The unified toolbar height.

<a id="api-c4bdc4a4d34e4570"></a>

### [`MacOSWindowTitleHeight.Medium`](#api-c4bdc4a4d34e4570)


```csharp
Medium
```

The compact unified toolbar height.


<a id="api-155ca473a63dd442"></a>

## `class SeededRandom`

Random implementation that uses a fixed seed for deterministic output.

```csharp
public sealed class SeededRandom : IRandom
{
    public SeededRandom(int seed);
    public int Next(int minValue, int maxValue);
    public double NextDouble();
}
```

<a id="api-3a303447fb630f3d"></a>

### [`SeededRandom.SeededRandom(int seed)`](#api-3a303447fb630f3d)


```csharp
public SeededRandom(int seed);
```

Initializes a new seeded random instance.

- **`seed`** — The deterministic seed value.

<a id="api-e8de16c7ad0fc6df"></a>

### [`int SeededRandom.Next(int minValue, int maxValue)`](#api-e8de16c7ad0fc6df)


```csharp
public int Next(int minValue, int maxValue);
```

Returns a random integer within the specified range.

- **`minValue`** — Inclusive lower bound of the random number.

- **`maxValue`** — Exclusive upper bound of the random number.

**Returns:** A random integer in the specified range.

<a id="api-f0bf73ae96787662"></a>

### [`double SeededRandom.NextDouble()`](#api-f0bf73ae96787662)


```csharp
public double NextDouble();
```

Returns a random floating-point number in the range [0.0, 1.0).

**Returns:** A random floating-point number.


<a id="api-28cc33502b836146"></a>

## `class SystemClock`

Default clock implementation backed by `System.DateTime.Now`.

```csharp
public sealed class SystemClock : IClock
{
    public static SystemClock Default { get; }
    public DateTime Now { get; }
}
```

<a id="api-1e660c02381a444a"></a>

### [`SystemClock SystemClock.Default`](#api-1e660c02381a444a)


```csharp
public static SystemClock Default { get; }
```

Gets the shared default system clock instance.

<a id="api-45167531b615636e"></a>

### [`DateTime SystemClock.Now`](#api-45167531b615636e)


```csharp
public DateTime Now { get; }
```

Gets the current local time.


<a id="api-6c44bd5616f6c150"></a>

## `class SystemRandom`

Default random implementation backed by `System.Random.Shared`.

```csharp
public sealed class SystemRandom : IRandom
{
    public static SystemRandom Default { get; }

    public int Next(int minValue, int maxValue);
    public double NextDouble();
}
```

<a id="api-feb7e931f154c107"></a>

### [`SystemRandom SystemRandom.Default`](#api-feb7e931f154c107)


```csharp
public static SystemRandom Default { get; }
```

Gets the shared default system random instance.

<a id="api-6664d7b0cb85745c"></a>

### [`int SystemRandom.Next(int minValue, int maxValue)`](#api-6664d7b0cb85745c)


```csharp
public int Next(int minValue, int maxValue);
```

Returns a random integer within the specified range.

- **`minValue`** — Inclusive lower bound of the random number.

- **`maxValue`** — Exclusive upper bound of the random number.

**Returns:** A random integer in the specified range.

<a id="api-5827d12de88fe935"></a>

### [`double SystemRandom.NextDouble()`](#api-5827d12de88fe935)


```csharp
public double NextDouble();
```

Returns a random floating-point number in the range [0.0, 1.0).

**Returns:** A random floating-point number.


<a id="api-ddf8a9ad7329295a"></a>

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

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.

```csharp
public class Window : Abstract.IWindow, Abstract.IWindow.ISoftKeyboard, IServiceProvider, IDisposable
{
    public IServiceProvider Context { get; }

    public virtual object? GetService(Type serviceType);
    public List<IDisposable> DisposeQueue { get; }
    public bool DestroyOnClose { get; set; }
    public IRuntime Runtime { get; }
    public Actual.IWindow Actual { get; }
    public virtual Rect DisplayArea { get; set; }
    public virtual Rect SafeArea { get; set; }
    public virtual nfloat ScreenCornerRadius { get; set; }
    public virtual ITextMeasureContext? TextMeasureContext { get; }
    public RootView RootView { get; }
    public string InstrumentationName { get; }
    public IRenderSurfaceInstrumentsSink? RenderSurfaceInstruments { get; }
    public View Content { init; }

    public Window(IServiceProvider context);
    public string Title { get; set; }
    public bool RequireKeyboard { get; set; }

    public void Show();
    public virtual void Render(ref RenderEventRef renderEventRef);
    public virtual void WindowHitTest(ref WindowHitTestEventRef evRef);
    public virtual bool Closing();
    public virtual void Closed();
    public void Dispose();
    protected virtual void Dispose(bool disposing);
    protected virtual Actual.IWindow CreateActualWindow();
    public virtual void Invalidate();
    public virtual void OnMouseDown(ref MouseDownEventRef e);
    public virtual void OnMouseMove(ref MouseMoveEventRef e);
    public virtual void OnMouseUp(ref MouseUpEventRef e);
    public virtual void OnScrollWheel(ref ScrollWheelEventRef e);
    public virtual void OnZoom(ref ZoomEventRef e);
    public virtual void OnTouch(ref TouchEventRef e);
    public virtual void OnKeyDown(ref KeyEventRef e);
    public virtual void OnChar(ref KeyEventRef e);
    public virtual void OnAnimationFrame(ref FrameEventRef e);
    public virtual bool HasText { get; }
    public virtual bool IsSecureTextEntry { get; }

    public virtual void InsertText(ref InsertTextEventRef eventRef);
    public virtual void DeleteBackwards(ref DeleteBackwardsEventRef eventRef);
}
```

<a id="api-5431d6702990d762"></a>

### [`Window.Window(IServiceProvider context)`](#api-5431d6702990d762)


```csharp
public Window(IServiceProvider context);
```

Initializes a new instance of the [`Xui.Core.Abstract.Window`](../xui-core-abstract/index.md#api-ddf8a9ad7329295a) class. This creates the backing platform window.

- **`context`** — An optional scoped `System.IServiceProvider` for this window. If it implements `System.IDisposable`, it will be disposed when the window closes.

<a id="api-2c5fee2078884f25"></a>

### [`IWindow Window.Actual`](#api-2c5fee2078884f25)


```csharp
public Actual.IWindow Actual { get; }
```

Gets the underlying platform-specific window instance.

<a id="api-b6946c2c8f260934"></a>

### [`void Window.Closed()`](#api-b6946c2c8f260934)


```csharp
public virtual void Closed();
```

Invoked when the window is closed and cleanup should occur.

<a id="api-80f45c1ce58dd734"></a>

### [`bool Window.Closing()`](#api-80f45c1ce58dd734)


```csharp
public virtual bool Closing();
```

Invoked before the window closes. Returning `false` can cancel the closure.

**Returns:** `true` if the window may close; otherwise, `false`.

<a id="api-2f558248be850bc3"></a>

### [`View Window.Content`](#api-2f558248be850bc3)


```csharp
public View Content { init; }
```

Sets the root content view of this window.

<a id="api-210a2b65d5c1b787"></a>

### [`IServiceProvider Window.Context`](#api-210a2b65d5c1b787)


```csharp
public IServiceProvider Context { get; }
```

The service provider for this window.

<a id="api-8f3fab71f44d2ddd"></a>

### [`IWindow Window.CreateActualWindow()`](#api-8f3fab71f44d2ddd)


```csharp
protected virtual Actual.IWindow CreateActualWindow();
```

Creates the platform-specific window for this abstract window.

**Returns:** The platform implementation of [`Xui.Core.Actual.IWindow`](../xui-core-actual/index.md#api-f32685022d3435b2).

<a id="api-27557299c49197db"></a>

### [`void Window.DeleteBackwards(ref DeleteBackwardsEventRef eventRef)`](#api-27557299c49197db)


```csharp
public virtual void DeleteBackwards(ref DeleteBackwardsEventRef eventRef);
```

Requests deletion of content preceding the caret or selection.

- **`eventRef`** — The input event representing a backspace action.

<a id="api-a45e7f169e0c3025"></a>

### [`bool Window.DestroyOnClose`](#api-a45e7f169e0c3025)


```csharp
public bool DestroyOnClose { get; set; }
```

When `true` (the default), closing the window calls [`Xui.Core.Abstract.Window.Dispose`](../xui-core-abstract/index.md#api-4a6c9e9da3758296). Set to `false` for windows that survive being closed and reopened.

<a id="api-5f33ca2a9dc0e5b7"></a>

### [`Rect Window.DisplayArea`](#api-5f33ca2a9dc0e5b7)


```csharp
public virtual Rect DisplayArea { get; set; }
```

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.

Used by the layout system to determine the full available size.

<a id="api-4a6c9e9da3758296"></a>

### [`void Window.Dispose()`](#api-4a6c9e9da3758296)


```csharp
public void Dispose();
```

Releases all managed resources owned by this window. If the platform window is still open, it is closed first. Items in [`Xui.Core.Abstract.Window.DisposeQueue`](../xui-core-abstract/index.md#api-f29e1535951cc498) are disposed in order.

<a id="api-a0f3453c4f2c79db"></a>

### [`void Window.Dispose(bool disposing)`](#api-a0f3453c4f2c79db)


```csharp
protected virtual void Dispose(bool disposing);
```

- **`disposing`** — `true` when called from [`Xui.Core.Abstract.Window.Dispose`](../xui-core-abstract/index.md#api-4a6c9e9da3758296); `false` from a finalizer.

<a id="api-f29e1535951cc498"></a>

### [`List<IDisposable> Window.DisposeQueue`](#api-f29e1535951cc498)


```csharp
public List<IDisposable> DisposeQueue { get; }
```

A list of disposables disposed when the window closes.

<a id="api-2d7e35a95d71a032"></a>

### [`object? Window.GetService(Type serviceType)`](#api-2d7e35a95d71a032)


```csharp
public virtual object? GetService(Type serviceType);
```

Gets the service object of the specified type.

- **`serviceType`** — An object that specifies the type of service object to get.

**Returns:** A service object of type `serviceType`. -or- `null` if there is no service object of type `serviceType`.

<a id="api-ff11f1e103971cf6"></a>

### [`bool Window.HasText`](#api-ff11f1e103971cf6)


```csharp
public virtual bool HasText { get; }
```

Whether the focused text client contains text.

<a id="api-10adc9db6914a664"></a>

### [`void Window.InsertText(ref InsertTextEventRef eventRef)`](#api-10adc9db6914a664)


```csharp
public virtual void InsertText(ref InsertTextEventRef eventRef);
```

Requests insertion of one or more characters into the current input context.

- **`eventRef`** — The input event containing the text to insert.

<a id="api-06bff3485bb74824"></a>

### [`string Window.InstrumentationName`](#api-06bff3485bb74824)


```csharp
public string InstrumentationName { get; }
```

Stable name used to identify this window&#39;s render surface in instrumentation.

<a id="api-6a017f265bca42a6"></a>

### [`void Window.Invalidate()`](#api-6a017f265bca42a6)


```csharp
public virtual void Invalidate();
```

Requests a visual invalidation/redraw of this window.

<a id="api-244451174b83fcdc"></a>

### [`bool Window.IsSecureTextEntry`](#api-244451174b83fcdc)


```csharp
public virtual bool IsSecureTextEntry { get; }
```

Whether the focused text client requires password entry.

<a id="api-7cd3d1ef225392b2"></a>

### [`void Window.OnAnimationFrame(ref FrameEventRef e)`](#api-7cd3d1ef225392b2)


```csharp
public virtual void OnAnimationFrame(ref FrameEventRef e);
```

Invoked once per frame to propagate animation timing information.

- **`animationFrame`** — Timing details for the current animation frame.

<a id="api-a3a2d9f40ab5fec2"></a>

### [`void Window.OnChar(ref KeyEventRef e)`](#api-a3a2d9f40ab5fec2)


```csharp
public virtual void OnChar(ref KeyEventRef e);
```

Invoked when a character is input (after keyboard translation).

- **`e`** — The keyboard event data with the translated character.

<a id="api-3bced994745f6df1"></a>

### [`void Window.OnKeyDown(ref KeyEventRef e)`](#api-3bced994745f6df1)


```csharp
public virtual void OnKeyDown(ref KeyEventRef e);
```

Invoked when a key is pressed.

- **`e`** — The keyboard event data.

<a id="api-18e3ed233113ede8"></a>

### [`void Window.OnMouseDown(ref MouseDownEventRef e)`](#api-18e3ed233113ede8)


```csharp
public virtual void OnMouseDown(ref MouseDownEventRef e);
```

Invoked when a mouse button is pressed within the window.

- **`evRef`** — The mouse down event data.

<a id="api-06498d4c8e90808f"></a>

### [`void Window.OnMouseMove(ref MouseMoveEventRef e)`](#api-06498d4c8e90808f)


```csharp
public virtual void OnMouseMove(ref MouseMoveEventRef e);
```

Invoked when the mouse is moved within the window.

- **`evRef`** — The mouse movement event data.

<a id="api-84615a122f0613b0"></a>

### [`void Window.OnMouseUp(ref MouseUpEventRef e)`](#api-84615a122f0613b0)


```csharp
public virtual void OnMouseUp(ref MouseUpEventRef e);
```

Invoked when a mouse button is released within the window.

- **`evRef`** — The mouse up event data.

<a id="api-516d3898f0dc56f4"></a>

### [`void Window.OnScrollWheel(ref ScrollWheelEventRef e)`](#api-516d3898f0dc56f4)


```csharp
public virtual void OnScrollWheel(ref ScrollWheelEventRef e);
```

Invoked when the scroll wheel is used within the window.

- **`evRef`** — The scroll wheel event data.

<a id="api-dd57fba0586f023d"></a>

### [`void Window.OnTouch(ref TouchEventRef e)`](#api-dd57fba0586f023d)


```csharp
public virtual void OnTouch(ref TouchEventRef e);
```

Invoked when touch input occurs within the window.

- **`touchEventRef`** — The touch event data.

<a id="api-df1d63eab2571798"></a>

### [`void Window.OnZoom(ref ZoomEventRef e)`](#api-df1d63eab2571798)


```csharp
public virtual void OnZoom(ref ZoomEventRef e);
```

Routes a platform magnification gesture through the view tree.

<a id="api-a64d0ce4d84dcbce"></a>

### [`void Window.Render(ref RenderEventRef renderEventRef)`](#api-a64d0ce4d84dcbce)


```csharp
public virtual void Render(ref RenderEventRef renderEventRef);
```

Invoked during the render phase of the UI lifecycle. Responsible for triggering layout and visual updates.

- **`render`** — The render event data, including target rect and frame info.

<a id="api-7ce40177951bafcb"></a>

### [`IRenderSurfaceInstrumentsSink? Window.RenderSurfaceInstruments`](#api-7ce40177951bafcb)


```csharp
public IRenderSurfaceInstrumentsSink? RenderSurfaceInstruments { get; }
```

The instrumentation sink created for this window&#39;s render surface, if enabled.

<a id="api-6f5f58bb95448cd1"></a>

### [`bool Window.RequireKeyboard`](#api-6f5f58bb95448cd1)


```csharp
public bool RequireKeyboard { get; set; }
```

Requests that the soft keyboard be shown or hidden (on supported platforms).

<a id="api-ac0137d8e282694b"></a>

### [`RootView Window.RootView`](#api-ac0137d8e282694b)


```csharp
public RootView RootView { get; }
```

The root view that hosts the window&#39;s content hierarchy.

<a id="api-05dfe840cb04a71f"></a>

### [`IRuntime Window.Runtime`](#api-05dfe840cb04a71f)


```csharp
public IRuntime Runtime { get; }
```

The platform runtime used by this window.

<a id="api-68cf90e4a9acff52"></a>

### [`Rect Window.SafeArea`](#api-68cf90e4a9acff52)


```csharp
public virtual Rect SafeArea { get; set; }
```

Gets or sets the &quot;safe&quot; area of the window, excluding obstructions like notches or status bars. Important UI elements should be placed within this area.

Especially relevant on mobile devices and in emulator scenarios.

<a id="api-4ed671be7d23849b"></a>

### [`NFloat Window.ScreenCornerRadius`](#api-4ed671be7d23849b)


```csharp
public virtual nfloat ScreenCornerRadius { get; set; }
```

Gets or sets the corner radius of the physical screen, in logical pixels. Used to offset UI elements (such as scrollbar indicators) away from rounded screen edges. Zero on desktop platforms where the window has sharp corners.

<a id="api-e0b174e764e5aa92"></a>

### [`void Window.Show()`](#api-e0b174e764e5aa92)


```csharp
public void Show();
```

Makes the window visible and adds it to the list of open windows.

<a id="api-4aea7b0d45b9f8c8"></a>

### [`ITextMeasureContext? Window.TextMeasureContext`](#api-4aea7b0d45b9f8c8)


```csharp
public virtual ITextMeasureContext? TextMeasureContext { get; }
```

Gets the text measure context for this window, used for hit-testing text positions during pointer events. Null on platforms that do not provide one.

<a id="api-6809f819f9a6a8f3"></a>

### [`string Window.Title`](#api-6809f819f9a6a8f3)


```csharp
public string Title { get; set; }
```

Gets or sets the window title (where supported by the platform).

<a id="api-8d9a9bc67b083d9d"></a>

### [`void Window.WindowHitTest(ref WindowHitTestEventRef evRef)`](#api-8d9a9bc67b083d9d)


```csharp
public virtual void WindowHitTest(ref WindowHitTestEventRef evRef);
```

Invoked when the system requests a hit test for window interaction. Allows the app to indicate whether a region is draggable, resizable, etc.

- **`evRef`** — The hit test event containing pointer position and window bounds.

