# Xui.Core.UI

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

## Types

- [`readonly struct ArrangeConstraints`](#api-28a407a4c27a12a7)
- [`ref struct AttachEventRef`](#api-2cc4c39f835d3700)
- [`class Border`](#api-40ff3aff25d07ab1)
- [`struct ClassNameCollection`](#api-2ec2dc3356a3bb16)
- [`ref struct DetachEventRef`](#api-77d16783170c4ceb)
- [`enum Direction`](#api-317eba016be66166)
- [`enum Flow`](#api-e3fb0d4885de9214)
- [`enum FlowDirection`](#api-7e4594aafdad554b)
- [`enum HorizontalAlignment`](#api-3c861a3213778eb2)
- [`class HorizontalStack`](#api-ef3996d9ee643e7a)
- [`class HorizontalUniformStack`](#api-1b62c9196075bdd5)
- [`interface IFocus`](#api-5abbfec52af9d1b6)
- [`interface IFullScreenView`](#api-f0fdce6e7c1c91a1)
- [`interface IOverlay`](#api-9cf5cdb6a98d8a95)
- [`interface IPopup`](#api-a0d06e1c0ac3f2ca)
- [`interface ITextEditingClient`](#api-3e58774e1d6a891a)
- [`interface ITextInputClient`](#api-c13ff2c2881286af)
- [`class ImageView`](#api-6d17c006d1d48ed3)
- [`class Label`](#api-8270f69ed4cb33e8)
- [`enum LayoutAlign`](#api-d2ca49df66fecaa4)
- [`readonly struct LayoutFrameContext`](#api-b44d44b3c275447a)
- [`struct LayoutMeasurements`](#api-a6950d3e7d8e9fc5)
- [`enum LayoutPass`](#api-531ab14fb1f5cd19)
- [`enum LayoutSizeMode`](#api-b395816195843519)
- [`readonly struct LayoutUpdate`](#api-ea9e22b7bf67e9ca)
- [`readonly struct MeasureConstraints`](#api-6d05730f979a548a)
- [`enum PopupEffect`](#api-555eb501f75baeca)
- [`enum PopupPlacement`](#api-db23050b5670eae6)
- [`class RootView`](#api-2747bdc1789f9314)
- [`enum ScrollDirection`](#api-f587228900f3a6aa)
- [`class ScrollView`](#api-bb441101c83090ab)
- [`class TextBox`](#api-7d69daddcd1aabf7)
- [`class TransformView`](#api-e8882896c9ada3c1)
- [`enum VerticalAlignment`](#api-7f90709ad1004f80)
- [`class VerticalStack`](#api-a2a257252112e769)
- [`class VerticalUniformStack`](#api-ca77f68116248c39)
- [`class View`](#api-0389f82d4babca03)
- [`class View.Extra`](#api-5a849cb74e86a6d1)
- [`class View.Extra<T>`](#api-ed6bc14fbf8104d5)
- [`enum View.ViewFlags`](#api-528f3e45b986486f)
- [`class ViewCollection`](#api-1979bdac6ae93688)
- [`class ViewExtensions`](#api-ec2921e0186fa254)
- [`readonly ref struct ViewExtensions.ParentsEnumerable`](#api-94b5fcb77b2b33a2)
- [`ref struct ViewExtensions.ParentsEnumerable.Enumerator`](#api-32961d9d8988900e)
- [`enum WritingMode`](#api-9b30940072677854)

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

## `readonly struct ArrangeConstraints`

Immutable input to an arrangement operation.

```csharp
public readonly struct ArrangeConstraints
{
    public ArrangeConstraints(Size availableSize, Size desiredSize, Point anchor, LayoutSizeMode xSize = LayoutSizeMode.Exact, LayoutSizeMode ySize = LayoutSizeMode.Exact, LayoutAlign xAlign = LayoutAlign.Start, LayoutAlign yAlign = LayoutAlign.Start);
    public Size AvailableSize { get; }
    public Size DesiredSize { get; }
    public Point Anchor { get; }
    public LayoutSizeMode XSize { get; }
    public LayoutSizeMode YSize { get; }
    public LayoutAlign XAlign { get; }
    public LayoutAlign YAlign { get; }
}
```

<a id="api-18a3abe91ad215bc"></a>

### [`ArrangeConstraints.ArrangeConstraints(Size availableSize, Size desiredSize, Point anchor, LayoutSizeMode xSize = LayoutSizeMode.Exact, LayoutSizeMode ySize = LayoutSizeMode.Exact, LayoutAlign xAlign = LayoutAlign.Start, LayoutAlign yAlign = LayoutAlign.Start)`](#api-18a3abe91ad215bc)


```csharp
public ArrangeConstraints(Size availableSize, Size desiredSize, Point anchor, LayoutSizeMode xSize = LayoutSizeMode.Exact, LayoutSizeMode ySize = LayoutSizeMode.Exact, LayoutAlign xAlign = LayoutAlign.Start, LayoutAlign yAlign = LayoutAlign.Start);
```

Initializes arrangement constraints.

<a id="api-c32d19fb1f474671"></a>

### [`Point ArrangeConstraints.Anchor`](#api-c32d19fb1f474671)


```csharp
public Point Anchor { get; }
```

Reference point for alignment.

<a id="api-d71a91c1059fc88a"></a>

### [`Size ArrangeConstraints.AvailableSize`](#api-d71a91c1059fc88a)


```csharp
public Size AvailableSize { get; }
```

Available margin-box size.

<a id="api-9c340517cbdbc366"></a>

### [`Size ArrangeConstraints.DesiredSize`](#api-9c340517cbdbc366)


```csharp
public Size DesiredSize { get; }
```

Desired margin-box size from measurement.

<a id="api-06a38fece58aa293"></a>

### [`LayoutAlign ArrangeConstraints.XAlign`](#api-06a38fece58aa293)


```csharp
public LayoutAlign XAlign { get; }
```

Horizontal anchor alignment.

<a id="api-b4286bcca6a9f24d"></a>

### [`LayoutSizeMode ArrangeConstraints.XSize`](#api-b4286bcca6a9f24d)


```csharp
public LayoutSizeMode XSize { get; }
```

Horizontal sizing mode.

<a id="api-2d859f90eb107063"></a>

### [`LayoutAlign ArrangeConstraints.YAlign`](#api-2d859f90eb107063)


```csharp
public LayoutAlign YAlign { get; }
```

Vertical anchor alignment.

<a id="api-885c3d7c38380145"></a>

### [`LayoutSizeMode ArrangeConstraints.YSize`](#api-885c3d7c38380145)


```csharp
public LayoutSizeMode YSize { get; }
```

Vertical sizing mode.


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

## `ref struct AttachEventRef`

Passed to [`Xui.Core.UI.View.OnAttach(Xui.Core.UI.AttachEventRef@)`](../xui-core-ui/index.md#api-a7a7da932e1a6cf9) when a view is added to the visual tree. Carries tree-wide shared resources (e.g. instrumentation) down the DFS walk so every view in the subtree receives them without per-view service lookups.

```csharp
public ref struct AttachEventRef
{
    public InstrumentsAccessor Instruments;
    public AttachEventRef();
}
```

<a id="api-0575e958b7c0984d"></a>

### [`AttachEventRef.AttachEventRef()`](#api-0575e958b7c0984d)


```csharp
public AttachEventRef();
```

Initializes a new [`Xui.Core.UI.AttachEventRef`](../xui-core-ui/index.md#api-2cc4c39f835d3700).

<a id="api-e852ae2e190c5032"></a>

### [`InstrumentsAccessor AttachEventRef.Instruments`](#api-e852ae2e190c5032)


```csharp
public InstrumentsAccessor Instruments;
```

Instrumentation sink for the visual tree. Views receive this during attach and store it so invalidation methods (e.g. [`Xui.Core.UI.View.InvalidateRender`](../xui-core-ui/index.md#api-38e13032e74cfcfb), [`Xui.Core.UI.View.RequestAnimationFrame`](../xui-core-ui/index.md#api-0cb1c1f63a3f65ad)) can log consistently with the render-surface instrumentation carried by [`Xui.Core.UI.LayoutFrameContext.Instruments`](../xui-core-ui/index.md#api-d2504699dd70f2e2).


<a id="api-40ff3aff25d07ab1"></a>

## `class Border`

A view that draws a background, border, and padding around a single child content view. All rendering is owned by [`Xui.Core.UI.Layer.BorderLayer`2`](../xui-core-ui-layer/index.md#api-ce3e0b25f8e8191f) composed with [`Xui.Core.UI.Layer.ContentLayer`](../xui-core-ui-layer/index.md#api-57531bb01cd513a7). The child view lives in `Layer.Child.Child` and is managed via the standard [`Xui.Core.UI.View.SetProtectedChild``1(``0@,``0)`](../xui-core-ui/index.md#api-427acb85419238ae) lifecycle.

```csharp
public class Border : LayerView<View, BorderLayer<View, ContentLayer>>
{
    public View? Content { get; set; }
    public Frame BorderThickness { get; set; }
    public CornerRadius CornerRadius { get; set; }
    public Color BackgroundColor { get; set; }
    public Color BorderColor { get; set; }
    public Frame Padding { get; set; }
    public override int Count { get; }

    public override View this[int index] { get; }
}
```

<a id="api-011e00ca47cbaffc"></a>

### [`Color Border.BackgroundColor`](#api-011e00ca47cbaffc)


```csharp
public Color BackgroundColor { get; set; }
```

Gets or sets the background fill color.

<a id="api-453922526ebc2d4a"></a>

### [`Color Border.BorderColor`](#api-453922526ebc2d4a)


```csharp
public Color BorderColor { get; set; }
```

Gets or sets the border stroke color.

<a id="api-c25789c825750dcc"></a>

### [`Frame Border.BorderThickness`](#api-c25789c825750dcc)


```csharp
public Frame BorderThickness { get; set; }
```

Gets or sets the per-side border thickness.

<a id="api-656e5fb1fff7e33e"></a>

### [`View? Border.Content`](#api-656e5fb1fff7e33e)


```csharp
public View? Content { get; set; }
```

Gets or sets the content view displayed inside the border.

<a id="api-4cb4b6791d3144f4"></a>

### [`CornerRadius Border.CornerRadius`](#api-4cb4b6791d3144f4)


```csharp
public CornerRadius CornerRadius { get; set; }
```

Gets or sets the corner radius.

<a id="api-ea0da9825132c50a"></a>

### [`int Border.Count`](#api-ea0da9825132c50a)


```csharp
public override int Count { get; }
```

Returns the number of child views. Used by layout containers and traversal logic. Leaf views should return 0.

<a id="api-9f2c7fe6163aa9ca"></a>

### [`View Border.this[int index]`](#api-9f2c7fe6163aa9ca)


```csharp
public override View this[int index] { get; }
```

Indexer to access child views by index. Layout containers should implement this to expose their children.

<a id="api-9b2d93028888bac2"></a>

### [`Frame Border.Padding`](#api-9b2d93028888bac2)


```csharp
public Frame Padding { get; set; }
```

Gets or sets the padding between the border edge and the content.


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

## `struct ClassNameCollection`

A compact collection of CSS-like class name strings for a view. Stores up to 3 class names inline without allocation. If more are added, spills over into a `System.Collections.Generic.HashSet`1`.

```csharp
public struct ClassNameCollection : IEnumerable<string>
{
    public readonly int Count { get; }

    public readonly bool Contains(string className);
    public bool Add(string className);
    public bool Remove(string className);
    public static ClassNameCollection operator +(ClassNameCollection collection, string className);
    public static ClassNameCollection operator -(ClassNameCollection collection, string className);
    public readonly IEnumerator<string> GetEnumerator();
}
```

<a id="api-390164db5b4fce12"></a>

### [`bool ClassNameCollection.Add(string className)`](#api-390164db5b4fce12)


```csharp
public bool Add(string className);
```

Adds a class name to the collection. Returns true if it was added (not already present).

<a id="api-4da105bb10832fa1"></a>

### [`readonly bool ClassNameCollection.Contains(string className)`](#api-4da105bb10832fa1)


```csharp
public readonly bool Contains(string className);
```

Returns true if the collection contains the specified class name.

<a id="api-bd7bd280fa189188"></a>

### [`readonly int ClassNameCollection.Count`](#api-bd7bd280fa189188)


```csharp
public readonly int Count { get; }
```

Returns the number of class names in the collection.

<a id="api-dee2e0bfa7d90272"></a>

### [`readonly IEnumerator<string> ClassNameCollection.GetEnumerator()`](#api-dee2e0bfa7d90272)


```csharp
public readonly IEnumerator<string> GetEnumerator();
```

Returns an enumerator that iterates over all class names in the collection.

<a id="api-354772ae1d6f2f0e"></a>

### [`bool ClassNameCollection.Remove(string className)`](#api-354772ae1d6f2f0e)


```csharp
public bool Remove(string className);
```

Removes a class name from the collection. Returns true if it was found and removed.

<a id="api-c57fb86d4ac9a0cb"></a>

### [`ClassNameCollection ClassNameCollection.operator +(ClassNameCollection collection, string className)`](#api-c57fb86d4ac9a0cb)


```csharp
public static ClassNameCollection operator +(ClassNameCollection collection, string className);
```

Adds a class name to the collection and returns the updated collection.

<a id="api-828226b764479a75"></a>

### [`ClassNameCollection ClassNameCollection.operator -(ClassNameCollection collection, string className)`](#api-828226b764479a75)


```csharp
public static ClassNameCollection operator -(ClassNameCollection collection, string className);
```

Removes a class name from the collection and returns the updated collection.


<a id="api-77d16783170c4ceb"></a>

## `ref struct DetachEventRef`

Passed to [`Xui.Core.UI.View.OnDetach(Xui.Core.UI.DetachEventRef@)`](../xui-core-ui/index.md#api-90c9ac8ec8230a8f) when a view is removed from the visual tree.

```csharp
public ref struct DetachEventRef
{
    public DetachEventRef();
}
```

<a id="api-39e1d31a5f168531"></a>

### [`DetachEventRef.DetachEventRef()`](#api-39e1d31a5f168531)


```csharp
public DetachEventRef();
```

Initializes a new [`Xui.Core.UI.DetachEventRef`](../xui-core-ui/index.md#api-77d16783170c4ceb).


<a id="api-317eba016be66166"></a>

## `enum Direction`

Indicates the semantic inline direction of content, such as left-to-right or right-to-left. Used to resolve text alignment, layout flow, and mirroring behavior.

```csharp
public enum Direction : byte
{
    Inherit = 0,
    LeftToRight = 1,
    RightToLeft = 2
}
```

<a id="api-0e2be28dbd4a3c8f"></a>

### [`Direction.Inherit`](#api-0e2be28dbd4a3c8f)


```csharp
Inherit = 0
```

Inherit direction from the parent view.

<a id="api-eba6d66be303df5f"></a>

### [`Direction.LeftToRight`](#api-eba6d66be303df5f)


```csharp
LeftToRight = 1
```

Left-to-right flow (default for Western languages).

<a id="api-9355426ed450cd6a"></a>

### [`Direction.RightToLeft`](#api-9355426ed450cd6a)


```csharp
RightToLeft = 2
```

Right-to-left flow (used in Arabic, Hebrew, etc).


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

## `enum Flow`

Controls whether layout and rendering should respect directionality and writing mode. Used to suppress mirroring and bidi-aware behavior for diagrams, graphs, and non-linguistic views.

```csharp
public enum Flow : byte
{
    Inherit = 0,
    Aware = 1,
    Unaware = 2
}
```

<a id="api-ce4d886e4bc5bad4"></a>

### [`Flow.Aware`](#api-ce4d886e4bc5bad4)


```csharp
Aware = 1
```

Enable direction-aware and writing-mode-aware behavior.

<a id="api-30cfea54da6f6334"></a>

### [`Flow.Inherit`](#api-30cfea54da6f6334)


```csharp
Inherit = 0
```

Inherit flow behavior from the parent view.

<a id="api-a97ad8aba8ad8444"></a>

### [`Flow.Unaware`](#api-a97ad8aba8ad8444)


```csharp
Unaware = 2
```

Disable all direction-aware layout and rendering. Used for charts, maps, etc.


<a id="api-7e4594aafdad554b"></a>

## `enum FlowDirection`

Represents the resolved physical direction of layout flow along an axis. This is derived from [`Xui.Core.UI.WritingMode`](../xui-core-ui/index.md#api-9b30940072677854) and [`Xui.Core.UI.Direction`](../xui-core-ui/index.md#api-317eba016be66166), and is used to control stacking, alignment, and layout flow along block or inline axes.

```csharp
public enum FlowDirection : byte
{
    LeftToRight = 0,
    RightToLeft = 1,
    TopToBottom = 2,
    BottomToTop = 3
}
```

<a id="api-e3d4a576f4d6580b"></a>

### [`FlowDirection.BottomToTop`](#api-e3d4a576f4d6580b)


```csharp
BottomToTop = 3
```

Content flows from bottom to top.

<a id="api-2790d3513c0c23c3"></a>

### [`FlowDirection.LeftToRight`](#api-2790d3513c0c23c3)


```csharp
LeftToRight = 0
```

Content flows from left to right.

<a id="api-01a77ca14e090b9e"></a>

### [`FlowDirection.RightToLeft`](#api-01a77ca14e090b9e)


```csharp
RightToLeft = 1
```

Content flows from right to left.

<a id="api-8a70be4366e402b8"></a>

### [`FlowDirection.TopToBottom`](#api-8a70be4366e402b8)


```csharp
TopToBottom = 2
```

Content flows from top to bottom.


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

## `enum HorizontalAlignment`

Specifies how a view should be aligned horizontally within its layout bounds. Used by parent containers during layout to position the view along the inline axis.

```csharp
public enum HorizontalAlignment : byte
{
    Stretch = 0,
    Left = 1,
    Center = 2,
    Right = 3
}
```

<a id="api-213c8d3fa59ba137"></a>

### [`HorizontalAlignment.Center`](#api-213c8d3fa59ba137)


```csharp
Center = 2
```

Center horizontally within the available space.

<a id="api-798eb3a5858cbc5e"></a>

### [`HorizontalAlignment.Left`](#api-798eb3a5858cbc5e)


```csharp
Left = 1
```

Align to the left edge (or start edge in LTR layouts).

<a id="api-96eb597ee6093b9b"></a>

### [`HorizontalAlignment.Right`](#api-96eb597ee6093b9b)


```csharp
Right = 3
```

Align to the right edge (or start edge in RTL layouts).

<a id="api-c43100e882d1ddec"></a>

### [`HorizontalAlignment.Stretch`](#api-c43100e882d1ddec)


```csharp
Stretch = 0
```

Stretch to fill the full available horizontal space.


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

## `class HorizontalStack`

A layout container that arranges its children horizontally from left to right. Each child is measured with unconstrained width and a constrained height. The container expands to fit the combined width of all children.

```csharp
public class HorizontalStack : ViewCollection
{
    protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
    protected override void ArrangeCore(Rect rect, IMeasureContext context);
}
```

<a id="api-7e6ec868daabcf66"></a>

### [`void HorizontalStack.ArrangeCore(Rect rect, IMeasureContext context)`](#api-7e6ec868daabcf66)


```csharp
protected override void ArrangeCore(Rect rect, IMeasureContext context);
```

Override to arrange children within this view&#39;s final frame.

<a id="api-0ec27c98dfb1d3fc"></a>

### [`Size HorizontalStack.MeasureCore(Size availableBorderEdgeSize, IMeasureContext context)`](#api-0ec27c98dfb1d3fc)


```csharp
protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
```

Override to compute the desired border-edge size.


<a id="api-1b62c9196075bdd5"></a>

## `class HorizontalUniformStack`

A layout container that arranges its children in a horizontal stack, assigning each child the same width.

If the parent provides a constrained width, the container divides the available width equally among all children.



If the width is unconstrained (infinite), the container measures each child to determine the maximum width, and assigns that uniform width to all columns.



The height of the container is based on the tallest child.

```csharp
public class HorizontalUniformStack : ViewCollection
{
    protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
    protected override void ArrangeCore(Rect rect, IMeasureContext context);
}
```

<a id="api-8260bb208734ec97"></a>

### [`void HorizontalUniformStack.ArrangeCore(Rect rect, IMeasureContext context)`](#api-8260bb208734ec97)


```csharp
protected override void ArrangeCore(Rect rect, IMeasureContext context);
```

Override to arrange children within this view&#39;s final frame.

<a id="api-7aee390e9b7bfeab"></a>

### [`Size HorizontalUniformStack.MeasureCore(Size availableBorderEdgeSize, IMeasureContext context)`](#api-7aee390e9b7bfeab)


```csharp
protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
```

Measures the desired size of this layout container and its children, based on the available space provided by the parent.

- **`availableBorderEdgeSize`** — The space available for layout, excluding padding and borders.

- **`context`** — The measure context used for child measurement.

**Returns:** The desired size of this container based on its layout strategy.


<a id="api-5abbfec52af9d1b6"></a>

## `interface IFocus`

Service interface for programmatic focus navigation. Resolved via `this.GetService<IFocus>()` from any [`Xui.Core.UI.View`](../xui-core-ui/index.md#api-0389f82d4babca03). [`Xui.Core.UI.RootView`](../xui-core-ui/index.md#api-2747bdc1789f9314) provides the default implementation.

```csharp
public interface IFocus
{
    void Next();
    void Previous();
    View? GetNext(bool wrap = false);
    View? GetPrevious(bool wrap = false);
    View? FocusedView { get; set; }
}
```

<a id="api-b255548752a63d87"></a>

### [`View? IFocus.FocusedView`](#api-b255548752a63d87)


```csharp
View? FocusedView { get; set; }
```

Gets or sets the view that currently holds keyboard focus. Setting to `null` clears focus. Setting fires [`Xui.Core.UI.View.OnBlur`](../xui-core-ui/index.md#api-495b845ed71068e3) / [`Xui.Core.UI.View.OnFocus`](../xui-core-ui/index.md#api-941e3579eb5a6d53) on the affected views.

<a id="api-0f6ecf2f7065e492"></a>

### [`View? IFocus.GetNext(bool wrap = false)`](#api-0f6ecf2f7065e492)


```csharp
View? GetNext(bool wrap = false);
```

Returns the next focusable view without moving focus. Does not wrap by default.

<a id="api-476ab7b2b6aeec00"></a>

### [`View? IFocus.GetPrevious(bool wrap = false)`](#api-476ab7b2b6aeec00)


```csharp
View? GetPrevious(bool wrap = false);
```

Returns the preceding focusable view without moving focus. Does not wrap by default.

<a id="api-117ca939764a9dde"></a>

### [`void IFocus.Next()`](#api-117ca939764a9dde)


```csharp
void Next();
```

Moves focus to the next focusable element (same order as Tab).

<a id="api-346d1091e0175e95"></a>

### [`void IFocus.Previous()`](#api-346d1091e0175e95)


```csharp
void Previous();
```

Moves focus to the previous focusable element (same order as Shift+Tab).


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

## `interface IFullScreenView`

Declares whether root content supplies an opaque background for the entire window.

This is a coverage promise, not a layout hint. Return true only when every draw covers the whole display area with opaque pixels. Hosts may skip their clear. Wrappers must forward the promise explicitly, and changes must invalidate the view.

```csharp
public interface IFullScreenView
{
    bool DrawsOpaqueFullScreen { get; }
}
```

<a id="api-4f6103f4ee50a351"></a>

### [`bool IFullScreenView.DrawsOpaqueFullScreen`](#api-4f6103f4ee50a351)


```csharp
bool DrawsOpaqueFullScreen { get; }
```

Whether the current state paints the whole display area opaquely.


<a id="api-9cf5cdb6a98d8a95"></a>

## `interface IOverlay`

A transient in-window overlay acquired via `GetService<IOverlay>()`. Rendered by [`Xui.Core.UI.RootView`](../xui-core-ui/index.md#api-2747bdc1789f9314) on top of all other content — no native window is created. Works on every platform (Windows, macOS, iOS, Android, Browser) with no platform-specific code.

Use this for cross-platform scenarios: mobile, simulators, web/SPA, or in-app surfaces like top-of-screen search fields that must stay within the window. For native OS-level popups that can extend outside the app window, use [`Xui.Core.UI.IPopup`](../xui-core-ui/index.md#api-a0d06e1c0ac3f2ca) instead. 

Usage pattern: 

```csharp
var overlay = this.GetService<IOverlay>();
overlay.Show(content, anchorRect, PopupPlacement.Below);
```

 The overlay auto-dismisses when the user clicks outside. Disposing the overlay closes it if still visible.

```csharp
public interface IOverlay : IDisposable
{
    void Show(View content, Rect anchorRect, PopupPlacement placement = PopupPlacement.Below, Size? size = null, PopupEffect effect = PopupEffect.None);
    void Close();
    bool IsVisible { get; }

    event Action? Closed;
}
```

<a id="api-58a4b5414745b1cd"></a>

### [`void IOverlay.Close()`](#api-58a4b5414745b1cd)


```csharp
void Close();
```

Closes the overlay if visible.

<a id="api-1aeea3c502234c95"></a>

### [`event Action? IOverlay.Closed`](#api-1aeea3c502234c95)


```csharp
event Action? Closed;
```

Raised when the overlay is dismissed (click-outside, explicit close, or parent window close).

<a id="api-1d374669b0b24a91"></a>

### [`bool IOverlay.IsVisible`](#api-1d374669b0b24a91)


```csharp
bool IsVisible { get; }
```

Whether the overlay is currently visible.

<a id="api-dda47ef6bc5e03ce"></a>

### [`void IOverlay.Show(View content, Rect anchorRect, PopupPlacement placement = PopupPlacement.Below, Size? size = null, PopupEffect effect = PopupEffect.None)`](#api-dda47ef6bc5e03ce)


```csharp
void Show(View content, Rect anchorRect, PopupPlacement placement = PopupPlacement.Below, Size? size = null, PopupEffect effect = PopupEffect.None);
```

Shows the overlay with the given content, positioned relative to `anchorRect` (in the owning window&#39;s coordinate space).

- **`content`** — The view to display inside the overlay.

- **`anchorRect`** — The rect of the triggering element in window coordinates. Used to position the overlay (for example, below a button).

- **`placement`** — Preferred placement direction.

- **`size`** — Desired overlay size. If `null`, a default size is used.

- **`effect`** — Visual backdrop effect (reserved for future use).


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

## `interface IPopup`

A transient native popup surface acquired via `GetService<IPopup>()`. Each call returns a new instance backed by a platform-specific child window, which can extend beyond the parent window bounds.

Available on platforms that support native popups (Windows, macOS). For cross-platform in-window overlays that work on all platforms including mobile, web, and simulators, use [`Xui.Core.UI.IOverlay`](../xui-core-ui/index.md#api-9cf5cdb6a98d8a95) instead. 

Usage pattern (similar to [`Xui.Core.Canvas.IImage`](../xui-core-canvas/index.md#api-e987d291ab0f00bb)): 

```csharp
var popup = this.GetService<IPopup>();
popup.Show(content, anchorRect, PopupPlacement.Below);
```

 The popup auto-dismisses when the user clicks outside. Disposing the popup closes it if still visible.

```csharp
public interface IPopup : IDisposable
{
    void Show(View content, Rect anchorRect, PopupPlacement placement = PopupPlacement.Below, Size? size = null, PopupEffect effect = PopupEffect.None);
    void Close();
    bool IsVisible { get; }

    event Action? Closed;
}
```

<a id="api-cdcc0484f778cfab"></a>

### [`void IPopup.Close()`](#api-cdcc0484f778cfab)


```csharp
void Close();
```

Closes the popup if visible.

<a id="api-32b0c9e3ac3f82eb"></a>

### [`event Action? IPopup.Closed`](#api-32b0c9e3ac3f82eb)


```csharp
event Action? Closed;
```

Raised when the popup is dismissed (click-outside, explicit close, or parent window close).

<a id="api-15f0d7901f02e0f1"></a>

### [`bool IPopup.IsVisible`](#api-15f0d7901f02e0f1)


```csharp
bool IsVisible { get; }
```

Whether the popup is currently visible.

<a id="api-5f13f7919f98aef5"></a>

### [`void IPopup.Show(View content, Rect anchorRect, PopupPlacement placement = PopupPlacement.Below, Size? size = null, PopupEffect effect = PopupEffect.None)`](#api-5f13f7919f98aef5)


```csharp
void Show(View content, Rect anchorRect, PopupPlacement placement = PopupPlacement.Below, Size? size = null, PopupEffect effect = PopupEffect.None);
```

Shows the popup with the given content, positioned relative to `anchorRect` (in the owning window&#39;s coordinate space).

- **`content`** — The view to display inside the popup.

- **`anchorRect`** — The rect of the triggering element in window coordinates. The platform uses this to position the popup so that (for example) a selected item aligns with the anchor text.

- **`placement`** — Preferred placement direction.

- **`size`** — Desired popup size. If `null`, the platform falls back to a default size.

- **`effect`** — Visual backdrop effect to apply to the popup window.


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

## `interface ITextEditingClient`

A canvas text editor that a native text-input service can manipulate.

```csharp
public interface ITextEditingClient : ITextInputClient
{
    TextEditingState Editor { get; }

    bool NativeSelection { get; set; }

    Rect InputBounds { get; }

    Rect GetCaretRect(int offset, ITextMeasureContext measure);
    int GetTextPosition(Point point, ITextMeasureContext measure);
}
```

<a id="api-cfb415f0acb7e91f"></a>

### [`TextEditingState ITextEditingClient.Editor`](#api-cfb415f0acb7e91f)


```csharp
TextEditingState Editor { get; }
```

The document and selection shared with the native input system.

<a id="api-088b509816fc0609"></a>

### [`Rect ITextEditingClient.GetCaretRect(int offset, ITextMeasureContext measure)`](#api-088b509816fc0609)


```csharp
Rect GetCaretRect(int offset, ITextMeasureContext measure);
```

Returns the caret rectangle for a UTF-16 offset, in logical window coordinates.

<a id="api-e4c9af15c274cf31"></a>

### [`int ITextEditingClient.GetTextPosition(Point point, ITextMeasureContext measure)`](#api-e4c9af15c274cf31)


```csharp
int GetTextPosition(Point point, ITextMeasureContext measure);
```

Hit-tests a logical window point, returning a UTF-16 grapheme boundary.

<a id="api-997173849ea5548f"></a>

### [`Rect ITextEditingClient.InputBounds`](#api-997173849ea5548f)


```csharp
Rect InputBounds { get; }
```

The input&#39;s hit-test bounds, in logical window coordinates.

<a id="api-636ef98fb7badab2"></a>

### [`bool ITextEditingClient.NativeSelection`](#api-636ef98fb7badab2)


```csharp
bool NativeSelection { get; set; }
```

Whether a native interaction owns caret, selection handles, and touch selection.


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

## `interface ITextInputClient`

Basic text-entry capabilities of a focusable view. Focus requests the software keyboard; the responder can query these traits without copying the text buffer. This does not imply support for marked text, IME composition, or native range editing.

```csharp
public interface ITextInputClient
{
    bool HasText { get; }

    bool IsPassword { get; }

    TextInputOptions InputOptions { get; }

    bool CanPerformInputAction(TextInputAction action);
    void PerformInputAction(TextInputAction action);
}
```

<a id="api-4acd8ee38b1b968a"></a>

### [`bool ITextInputClient.CanPerformInputAction(TextInputAction action)`](#api-4acd8ee38b1b968a)


```csharp
bool CanPerformInputAction(TextInputAction action);
```

Whether a keyboard action is currently available.

<a id="api-a7d30de756a03541"></a>

### [`bool ITextInputClient.HasText`](#api-a7d30de756a03541)


```csharp
bool HasText { get; }
```

Whether the input contains any text.

<a id="api-30f635250156db7d"></a>

### [`TextInputOptions ITextInputClient.InputOptions`](#api-30f635250156db7d)


```csharp
TextInputOptions InputOptions { get; }
```

Keyboard layout, content semantics and return-key action.

<a id="api-81bcb7dd9219535d"></a>

### [`bool ITextInputClient.IsPassword`](#api-81bcb7dd9219535d)


```csharp
bool IsPassword { get; }
```

Whether the input is a masked password field.

<a id="api-6bdab65c533eeb93"></a>

### [`void ITextInputClient.PerformInputAction(TextInputAction action)`](#api-6bdab65c533eeb93)


```csharp
void PerformInputAction(TextInputAction action);
```

Handles a keyboard action, including focus navigation or finishing editing.


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

## `class ImageView`

A view that displays an image. Works like `HTMLImageElement`: it holds an [`Xui.Core.Canvas.IImage`](../xui-core-canvas/index.md#api-e987d291ab0f00bb) handle (acquired from the service chain) and sets its source via [`Xui.Core.Canvas.IImage.Load(System.String)`](../xui-core-canvas/index.md#api-9abad04c49debcf0). The platform catalog handles caching and device-lost rehydration transparently.

```csharp
public class ImageView : View
{
    public string? Source { get; set; }

    protected override void OnActivate();
    protected override void OnDeactivate();
    protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
    protected override void RenderCore(IContext context);
}
```

<a id="api-50422617b106a209"></a>

### [`Size ImageView.MeasureCore(Size availableBorderEdgeSize, IMeasureContext context)`](#api-50422617b106a209)


```csharp
protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
```

Override to compute the desired border-edge size.

<a id="api-b810d1e36dac8eb6"></a>

### [`void ImageView.OnActivate()`](#api-b810d1e36dac8eb6)


```csharp
protected override void OnActivate();
```

Called when this view becomes active — it will receive events, render, and animate. Override this to start animations, subscribe to data sources, or acquire resources.

<a id="api-af5e476e031dcb90"></a>

### [`void ImageView.OnDeactivate()`](#api-af5e476e031dcb90)


```csharp
protected override void OnDeactivate();
```

Called when this view becomes dormant — it should stop animations, timers, and event subscriptions. The view may remain in the tree (e.g., in a virtualizing panel&#39;s recycle pool).

<a id="api-146d12b949a050ab"></a>

### [`void ImageView.RenderCore(IContext context)`](#api-146d12b949a050ab)


```csharp
protected override void RenderCore(IContext context);
```

Override to render this view and its children.

<a id="api-8449f2cb30fb3e19"></a>

### [`string? ImageView.Source`](#api-8449f2cb30fb3e19)


```csharp
public string? Source { get; set; }
```

Gets or sets the URI of the image to display. Setting this property triggers a load if the view is already active.


<a id="api-8270f69ed4cb33e8"></a>

## `class Label`

A view that displays a single line of styled text.

```csharp
public class Label : View
{
    public string Text { get; set; }
    public Color TextColor { get; set; }
    public Font Font { get; set; }
    public string FontFamily { get; set; }
    public nfloat FontSize { get; set; }
    public FontStyle FontStyle { get; set; }
    public FontWeight FontWeight { get; set; }
    public FontStretch FontStretch { get; set; }
    public nfloat LineHeight { get; set; }

    protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
    protected override void RenderCore(IContext context);
}
```

<a id="api-def9d79e6ef2c505"></a>

### [`Font Label.Font`](#api-def9d79e6ef2c505)


```csharp
public Font Font { get; set; }
```

Gets or sets the complete font used for text measurement and rendering.

<a id="api-d10c59ae96e84639"></a>

### [`string Label.FontFamily`](#api-d10c59ae96e84639)


```csharp
public string FontFamily { get; set; }
```

Gets or sets the font family used for rendering the text.

<a id="api-22e7d2fe0a1455ce"></a>

### [`NFloat Label.FontSize`](#api-22e7d2fe0a1455ce)


```csharp
public nfloat FontSize { get; set; }
```

Gets or sets the font size in points.

<a id="api-d0539f97e07d5cf4"></a>

### [`FontStretch Label.FontStretch`](#api-d0539f97e07d5cf4)


```csharp
public FontStretch FontStretch { get; set; }
```

Gets or sets the font stretch (e.g., condensed, semi-expanded etc.).

<a id="api-a79ce89f8a23ba95"></a>

### [`FontStyle Label.FontStyle`](#api-a79ce89f8a23ba95)


```csharp
public FontStyle FontStyle { get; set; }
```

Gets or sets the font style (e.g., normal, italic, oblique).

<a id="api-43adce84e3d0828e"></a>

### [`FontWeight Label.FontWeight`](#api-43adce84e3d0828e)


```csharp
public FontWeight FontWeight { get; set; }
```

Gets or sets the font weight (e.g., normal, bold, numeric weight).

<a id="api-a0cab7b93a782e46"></a>

### [`NFloat Label.LineHeight`](#api-a0cab7b93a782e46)


```csharp
public nfloat LineHeight { get; set; }
```

Gets or sets the line height of the text, in user units.

If set to a numeric value, this value overrides the default line height computation from the font metrics. If set to `System.Runtime.InteropServices.NFloat.NaN`, the line height will be automatically computed based on the font&#39;s ascender, descender, and line gap, or fallback to a platform-specific multiplier of the [`Xui.Core.Canvas.Font.FontSize`](../xui-core-canvas/index.md#api-425943c795617350) (typically 1.2&#215;).

<a id="api-4cfb2c667e5041d6"></a>

### [`Size Label.MeasureCore(Size availableBorderEdgeSize, IMeasureContext context)`](#api-4cfb2c667e5041d6)


```csharp
protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
```

Override to compute the desired border-edge size.

<a id="api-c0c7a8d8024cd363"></a>

### [`void Label.RenderCore(IContext context)`](#api-c0c7a8d8024cd363)


```csharp
protected override void RenderCore(IContext context);
```

Override to render this view and its children.

<a id="api-f80f4b6fbf033494"></a>

### [`string Label.Text`](#api-f80f4b6fbf033494)


```csharp
public string Text { get; set; }
```

Gets or sets the text content displayed by the label.

<a id="api-fcca0cdfc9feefab"></a>

### [`Color Label.TextColor`](#api-fcca0cdfc9feefab)


```csharp
public Color TextColor { get; set; }
```

Gets or sets the color used to fill the text.


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

## `enum LayoutAlign`

Defines an anchor alignment on one layout axis.

```csharp
public enum LayoutAlign : byte
{
    Start,
    Center,
    End,
}
```

<a id="api-38dac2412ce5c1d4"></a>

### [`LayoutAlign.Center`](#api-38dac2412ce5c1d4)


```csharp
Center
```

Align to the center.

<a id="api-659c28aabbf3aa7c"></a>

### [`LayoutAlign.End`](#api-659c28aabbf3aa7c)


```csharp
End
```

Align to the end edge.

<a id="api-5fb98c29c083f3fa"></a>

### [`LayoutAlign.Start`](#api-5fb98c29c083f3fa)


```csharp
Start
```

Align to the start edge.


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

## `readonly struct LayoutFrameContext`

Immutable services and timing shared by every view visited during one render-surface update.

```csharp
public readonly struct LayoutFrameContext
{
    public LayoutFrameContext(TimeSpan previousTime, TimeSpan currentTime, IMeasureContext? measureContext, IContext? renderContext, InstrumentsAccessor instruments);
    public TimeSpan PreviousTime { get; }
    public TimeSpan CurrentTime { get; }
    public IMeasureContext? MeasureContext { get; }
    public IContext? RenderContext { get; }
    public InstrumentsAccessor Instruments { get; }
}
```

<a id="api-be4f68ef77f2c982"></a>

### [`LayoutFrameContext.LayoutFrameContext(TimeSpan previousTime, TimeSpan currentTime, IMeasureContext? measureContext, IContext? renderContext, InstrumentsAccessor instruments)`](#api-be4f68ef77f2c982)


```csharp
public LayoutFrameContext(TimeSpan previousTime, TimeSpan currentTime, IMeasureContext? measureContext, IContext? renderContext, InstrumentsAccessor instruments);
```

Initializes a frame context.

<a id="api-a87f410dc82eba47"></a>

### [`TimeSpan LayoutFrameContext.CurrentTime`](#api-a87f410dc82eba47)


```csharp
public TimeSpan CurrentTime { get; }
```

Time of this frame.

<a id="api-d2504699dd70f2e2"></a>

### [`InstrumentsAccessor LayoutFrameContext.Instruments`](#api-d2504699dd70f2e2)


```csharp
public InstrumentsAccessor Instruments { get; }
```

Instrumentation associated with this render surface.

<a id="api-d0973697f8b01c9a"></a>

### [`IMeasureContext? LayoutFrameContext.MeasureContext`](#api-d0973697f8b01c9a)


```csharp
public IMeasureContext? MeasureContext { get; }
```

Measurement services for this render surface.

<a id="api-41ce6ee73f15e724"></a>

### [`TimeSpan LayoutFrameContext.PreviousTime`](#api-41ce6ee73f15e724)


```csharp
public TimeSpan PreviousTime { get; }
```

Time of the preceding frame.

<a id="api-a3632179c794f63a"></a>

### [`IContext? LayoutFrameContext.RenderContext`](#api-a3632179c794f63a)


```csharp
public IContext? RenderContext { get; }
```

Rendering context for this render surface.


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

## `struct LayoutMeasurements`

Per-view results written by an update. The caller owns this value and passes it by reference, so sibling updates cannot share or overwrite one another&#39;s results.

```csharp
public struct LayoutMeasurements
{
    public Size DesiredSize;
    public Rect ArrangedRect;
}
```

<a id="api-a4e8fbed80df416d"></a>

### [`Rect LayoutMeasurements.ArrangedRect`](#api-a4e8fbed80df416d)


```csharp
public Rect ArrangedRect;
```

Final border-edge rectangle produced by arrangement.

<a id="api-f657bdca7479a75f"></a>

### [`Size LayoutMeasurements.DesiredSize`](#api-f657bdca7479a75f)


```csharp
public Size DesiredSize;
```

Desired margin-box size produced by measurement.


<a id="api-531ab14fb1f5cd19"></a>

## `enum LayoutPass`

Passes that may be requested during a render-surface update.

```csharp
[Flags]
public enum LayoutPass : byte
{
    Animate = 1 << 0,
    Measure = 1 << 1,
    Arrange = 1 << 2,
    Render = 1 << 3,
}
```

<a id="api-7dad701244f7211a"></a>

### [`LayoutPass.Animate`](#api-7dad701244f7211a)


```csharp
Animate = 1 << 0
```

Advance time-based state.

<a id="api-757dbadeae42e690"></a>

### [`LayoutPass.Arrange`](#api-757dbadeae42e690)


```csharp
Arrange = 1 << 2
```

Arrange final frame.

<a id="api-8df8d8e1d4752158"></a>

### [`LayoutPass.Measure`](#api-8df8d8e1d4752158)


```csharp
Measure = 1 << 1
```

Measure desired size.

<a id="api-6e460701cdc04b04"></a>

### [`LayoutPass.Render`](#api-6e460701cdc04b04)


```csharp
Render = 1 << 3
```

Render the view.


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

## `enum LayoutSizeMode`

Defines how an axis participates in a layout pass.

```csharp
public enum LayoutSizeMode : byte
{
    Exact,
    AtMost,
}
```

<a id="api-9a98c23687259369"></a>

### [`LayoutSizeMode.AtMost`](#api-9a98c23687259369)


```csharp
AtMost
```

The view may size to content without exceeding the available size.

<a id="api-70baa8d08cad27f9"></a>

### [`LayoutSizeMode.Exact`](#api-70baa8d08cad27f9)


```csharp
Exact
```

The view must exactly match the available size.


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

## `readonly struct LayoutUpdate`

Pass selection and per-pass immutable constraints for one view update.

```csharp
public readonly struct LayoutUpdate
{
    public LayoutUpdate(LayoutPass pass, MeasureConstraints measure, ArrangeConstraints arrange);
    public LayoutPass Pass { get; }
    public MeasureConstraints Measure { get; }
    public ArrangeConstraints Arrange { get; }
    public bool IsAnimate { get; }
    public bool IsMeasure { get; }
    public bool IsArrange { get; }
    public bool IsRender { get; }
}
```

<a id="api-e916bb2ea0e86117"></a>

### [`LayoutUpdate.LayoutUpdate(LayoutPass pass, MeasureConstraints measure, ArrangeConstraints arrange)`](#api-e916bb2ea0e86117)


```csharp
public LayoutUpdate(LayoutPass pass, MeasureConstraints measure, ArrangeConstraints arrange);
```

Initializes a layout update.

<a id="api-54dd8f54d3360028"></a>

### [`ArrangeConstraints LayoutUpdate.Arrange`](#api-54dd8f54d3360028)


```csharp
public ArrangeConstraints Arrange { get; }
```

Arrangement constraints.

<a id="api-406e0b2ae51781c1"></a>

### [`bool LayoutUpdate.IsAnimate`](#api-406e0b2ae51781c1)


```csharp
public bool IsAnimate { get; }
```

Whether animation is requested.

<a id="api-653f573da0db57de"></a>

### [`bool LayoutUpdate.IsArrange`](#api-653f573da0db57de)


```csharp
public bool IsArrange { get; }
```

Whether arrangement is requested.

<a id="api-b346666e662e06bb"></a>

### [`bool LayoutUpdate.IsMeasure`](#api-b346666e662e06bb)


```csharp
public bool IsMeasure { get; }
```

Whether measurement is requested.

<a id="api-e16b29c420cffee1"></a>

### [`bool LayoutUpdate.IsRender`](#api-e16b29c420cffee1)


```csharp
public bool IsRender { get; }
```

Whether rendering is requested.

<a id="api-5fe33e068e2b743a"></a>

### [`MeasureConstraints LayoutUpdate.Measure`](#api-5fe33e068e2b743a)


```csharp
public MeasureConstraints Measure { get; }
```

Measurement constraints.

<a id="api-eb0b49e761bf1187"></a>

### [`LayoutPass LayoutUpdate.Pass`](#api-eb0b49e761bf1187)


```csharp
public LayoutPass Pass { get; }
```

Requested passes.


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

## `readonly struct MeasureConstraints`

Immutable input to a measurement operation.

```csharp
public readonly struct MeasureConstraints
{
    public MeasureConstraints(Size availableSize, LayoutSizeMode xSize = LayoutSizeMode.AtMost, LayoutSizeMode ySize = LayoutSizeMode.AtMost);
    public Size AvailableSize { get; }
    public LayoutSizeMode XSize { get; }
    public LayoutSizeMode YSize { get; }
}
```

<a id="api-4401bb7f535a1190"></a>

### [`MeasureConstraints.MeasureConstraints(Size availableSize, LayoutSizeMode xSize = LayoutSizeMode.AtMost, LayoutSizeMode ySize = LayoutSizeMode.AtMost)`](#api-4401bb7f535a1190)


```csharp
public MeasureConstraints(Size availableSize, LayoutSizeMode xSize = LayoutSizeMode.AtMost, LayoutSizeMode ySize = LayoutSizeMode.AtMost);
```

Initializes measurement constraints.

<a id="api-d5dff08713fe82fd"></a>

### [`Size MeasureConstraints.AvailableSize`](#api-d5dff08713fe82fd)


```csharp
public Size AvailableSize { get; }
```

Available margin-box size.

<a id="api-77405d1546acec37"></a>

### [`LayoutSizeMode MeasureConstraints.XSize`](#api-77405d1546acec37)


```csharp
public LayoutSizeMode XSize { get; }
```

Horizontal sizing mode.

<a id="api-fb8d538ac0d58d0d"></a>

### [`LayoutSizeMode MeasureConstraints.YSize`](#api-fb8d538ac0d58d0d)


```csharp
public LayoutSizeMode YSize { get; }
```

Vertical sizing mode.


<a id="api-555eb501f75baeca"></a>

## `enum PopupEffect`

Controls the visual backdrop material of a popup surface. Mirrors [`Xui.Core.Abstract.IWindow.IDesktopStyle.WindowBackdrop`](../xui-core-abstract/index.md#api-728ebccb1abfa087) for popup-specific use.

```csharp
public enum PopupEffect
{
    None = 0,
    Translucent = 1,
}
```

<a id="api-d72c9770f3f87e45"></a>

### [`PopupEffect.None`](#api-d72c9770f3f87e45)


```csharp
None = 0
```

Standard opaque popup with no translucency.

<a id="api-5b82636dd9bda476"></a>

### [`PopupEffect.Translucent`](#api-5b82636dd9bda476)


```csharp
Translucent = 1
```

Translucent popup using the system&#39;s standard popup/popover material. On macOS this uses `NSVisualEffectView` with the `Popover` material, which on macOS 26+ automatically gains the liquid-glass treatment.


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

## `enum PopupPlacement`

Specifies the preferred placement of a popup relative to its anchor rect. The platform may adjust placement to keep the popup on screen.

```csharp
public enum PopupPlacement
{
    Below,
    Above,
    Right,
    Left,
}
```

<a id="api-054dbae69e3a30d9"></a>

### [`PopupPlacement.Above`](#api-054dbae69e3a30d9)


```csharp
Above
```

Show above the anchor.

<a id="api-a763ce8a598d90ea"></a>

### [`PopupPlacement.Below`](#api-a763ce8a598d90ea)


```csharp
Below
```

Show below the anchor (default for dropdowns/comboboxes).

<a id="api-9f517f124b69b01d"></a>

### [`PopupPlacement.Left`](#api-9f517f124b69b01d)


```csharp
Left
```

Show to the left of the anchor.

<a id="api-b5666dd9a542e54a"></a>

### [`PopupPlacement.Right`](#api-b5666dd9a542e54a)


```csharp
Right
```

Show to the right of the anchor (e.g. nested/submenu).


<a id="api-2747bdc1789f9314"></a>

## `class RootView`

The root container view that bridges a [`Xui.Core.UI.RootView.Window`](../xui-core-ui/index.md#api-9ecba6490b5c067f) with its UI content hierarchy.

```csharp
public class RootView : View, IContent, IFocus
{
    public IRenderSurfaceInstrumentsSink? RenderSurfaceInstruments { get; }
    public EventRouter EventRouter { get; }
    public Window Window { get; }
    public View? FocusedView { get; set; }
    public View? Content { get; set; }
    public override int Count { get; }

    public override View this[int index] { get; }

    protected override Size MeasureCore(Size available, IMeasureContext context);
    protected override void ArrangeCore(Rect rect, IMeasureContext context);
    protected override void RenderCore(IContext context);
    public RootView(Window window);
    public override object? GetService(Type serviceType);
    protected override void OnChildRenderChanged(View child);
}
```

<a id="api-1f902595eb67beae"></a>

### [`RootView.RootView(Window window)`](#api-1f902595eb67beae)


```csharp
public RootView(Window window);
```

Initializes a new RootView for the given window.

- **`window`** — The window that owns this root view.

<a id="api-67a5645b23783fc1"></a>

### [`void RootView.ArrangeCore(Rect rect, IMeasureContext context)`](#api-67a5645b23783fc1)


```csharp
protected override void ArrangeCore(Rect rect, IMeasureContext context);
```

Override to arrange children within this view&#39;s final frame.

<a id="api-c25e0343798a9a8a"></a>

### [`View? RootView.Content`](#api-c25e0343798a9a8a)


```csharp
public View? Content { get; set; }
```

Gets or sets the single content view hosted by this root view.

<a id="api-036e77664f3087a2"></a>

### [`int RootView.Count`](#api-036e77664f3087a2)


```csharp
public override int Count { get; }
```

The content followed by visible in-window overlays, in render and hit-test order.

<a id="api-365d3d3d4dc9a9db"></a>

### [`EventRouter RootView.EventRouter`](#api-365d3d3d4dc9a9db)


```csharp
public EventRouter EventRouter { get; }
```

The input event router for this view tree.

<a id="api-d43745480189fa33"></a>

### [`View? RootView.FocusedView`](#api-d43745480189fa33)


```csharp
public View? FocusedView { get; set; }
```

The currently focused view within this tree, or null if none.

<a id="api-23783e3a303fd38b"></a>

### [`object? RootView.GetService(Type serviceType)`](#api-23783e3a303fd38b)


```csharp
public override object? GetService(Type serviceType);
```

Resolves a service of the given type by walking up the parent chain. Returns `null` if no ancestor provides the service.

<a id="api-216a3a85a2e6382e"></a>

### [`View RootView.this[int index]`](#api-216a3a85a2e6382e)


```csharp
public override View this[int index] { get; }
```

Gets the child view at the given index.

<a id="api-e5ae5c9eb20cd0bb"></a>

### [`Size RootView.MeasureCore(Size available, IMeasureContext context)`](#api-e5ae5c9eb20cd0bb)


```csharp
protected override Size MeasureCore(Size available, IMeasureContext context);
```

Override to compute the desired border-edge size.

<a id="api-acd95a2ecb3f770b"></a>

### [`void RootView.OnChildRenderChanged(View child)`](#api-acd95a2ecb3f770b)


```csharp
protected override void OnChildRenderChanged(View child);
```

Called when a child view signals that its rendered state has changed.

<a id="api-73c4665a930be7f2"></a>

### [`void RootView.RenderCore(IContext context)`](#api-73c4665a930be7f2)


```csharp
protected override void RenderCore(IContext context);
```

Override to render this view and its children.

<a id="api-b5d4c41315d55ec8"></a>

### [`IRenderSurfaceInstrumentsSink? RootView.RenderSurfaceInstruments`](#api-b5d4c41315d55ec8)


```csharp
public IRenderSurfaceInstrumentsSink? RenderSurfaceInstruments { get; }
```

The render-surface instruments that own this visual tree, if instrumentation is enabled.

<a id="api-9ecba6490b5c067f"></a>

### [`Window RootView.Window`](#api-9ecba6490b5c067f)


```csharp
public Window Window { get; }
```

The window that owns this root view.


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

## `enum ScrollDirection`

Controls which axis (or axes) a [`Xui.Core.UI.ScrollView`](../xui-core-ui/index.md#api-bb441101c83090ab) scrolls along.

```csharp
public enum ScrollDirection
{
    Vertical,
    Horizontal,
    Both
}
```

<a id="api-db32892edc207c39"></a>

### [`ScrollDirection.Both`](#api-db32892edc207c39)


```csharp
Both
```

Scrolls both axes simultaneously (map-panning style).

<a id="api-2ab76188d3950218"></a>

### [`ScrollDirection.Horizontal`](#api-2ab76188d3950218)


```csharp
Horizontal
```

Scrolls horizontally only.

<a id="api-f32595fac6bec7ce"></a>

### [`ScrollDirection.Vertical`](#api-f32595fac6bec7ce)


```csharp
Vertical
```

Scrolls vertically only (default).


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

## `class ScrollView`

A container that clips its content and allows scrolling via pointer drag/fling and scroll wheel input. Supports vertical, horizontal, or both axes. Displays thin overlay scrollbar indicators on the relevant edges.

```csharp
public partial class ScrollView
{
}
public partial class ScrollView
{
    public override void OnScrollWheel(ref ScrollWheelEventRef e);
}
public partial class ScrollView : View
{
    public Vector ScrollOffset { get; }

    public event Action<Vector>? ScrollChanged;
    public View? Overlay { get; set; }
    public nfloat ScrollbarWidth { get; set; }
    public nfloat ScrollbarEndInset { get; set; }
    public bool ClipToViewport { get; set; }
    public bool UseCompositionGroup { get; set; }
    public new ScrollDirection Direction { get; set; }
    public View? Content { get; set; }
    public override int Count { get; }

    public override View this[int index] { get; }

    protected override void OnActivate();
    protected override Size MeasureCore(Size available, IMeasureContext context);
    protected override void ArrangeCore(Rect rect, IMeasureContext context);
    public override Point TransformPoint(Point point);
    public override Point InverseTransformPoint(Point point);
    public override Rect TransformRect(Rect rect);
    public override Rect InverseTransformRect(Rect rect);
    public override bool HitTest(Point point);
    protected override void RenderCore(IContext context);
    public override void OnPointerEvent(ref PointerEventRef e, EventPhase phase);
    protected override void AnimateCore(TimeSpan previous, TimeSpan current);
    protected override void OnDeactivate();
}
```

<a id="api-c1406043ab3f3021"></a>

### [`void ScrollView.AnimateCore(TimeSpan previous, TimeSpan current)`](#api-c1406043ab3f3021)


```csharp
protected override void AnimateCore(TimeSpan previous, TimeSpan current);
```

Override to animate this view and its children.

<a id="api-513dd2fce9ace3db"></a>

### [`void ScrollView.ArrangeCore(Rect rect, IMeasureContext context)`](#api-513dd2fce9ace3db)


```csharp
protected override void ArrangeCore(Rect rect, IMeasureContext context);
```

Override to arrange children within this view&#39;s final frame.

<a id="api-41be3b4a44a0e7c8"></a>

### [`bool ScrollView.ClipToViewport`](#api-41be3b4a44a0e7c8)


```csharp
public bool ClipToViewport { get; set; }
```

Gets or sets whether content is clipped and culled to the viewport. Disable this for a root scroller that is laid out inside a safe area but is allowed to paint underneath the system areas while it scrolls.

<a id="api-81ff4c40291d6b20"></a>

### [`View? ScrollView.Content`](#api-81ff4c40291d6b20)


```csharp
public View? Content { get; set; }
```

Gets or sets the single child view to scroll.

<a id="api-8ceba780cd10c306"></a>

### [`int ScrollView.Count`](#api-8ceba780cd10c306)


```csharp
public override int Count { get; }
```

Number of child views.

<a id="api-f8d667ffe732614c"></a>

### [`ScrollDirection ScrollView.Direction`](#api-f8d667ffe732614c)


```csharp
public new ScrollDirection Direction { get; set; }
```

Gets or sets which axis (or axes) this scroll view responds to.

<a id="api-b423184759c27f84"></a>

### [`bool ScrollView.HitTest(Point point)`](#api-b423184759c27f84)


```csharp
public override bool HitTest(Point point);
```

Determines whether the given point (in this view&#39;s local coordinates) hits this view&#39;s visual bounds. Used for input dispatch and hit testing.

- **`point`** — The point to test, relative to this view&#39;s coordinate space.

**Returns:** `true` if the point is inside the view&#39;s frame; otherwise `false`.

<a id="api-cbad54f72a28cf01"></a>

### [`Point ScrollView.InverseTransformPoint(Point point)`](#api-cbad54f72a28cf01)


```csharp
public override Point InverseTransformPoint(Point point);
```

Maps a point from this view&#39;s local coordinate space into its parent coordinate space.

This must be the inverse of [`Xui.Core.UI.View.TransformPoint(Xui.Core.Math2D.Point)`](../xui-core-ui/index.md#api-624745fa8df45a58) for points that can be hit tested. It is separate so a view can support coordinate mappings that are not yet represented by the canvas transform API.

<a id="api-e5ae27439cbaaa6e"></a>

### [`Rect ScrollView.InverseTransformRect(Rect rect)`](#api-e5ae27439cbaaa6e)


```csharp
public override Rect InverseTransformRect(Rect rect);
```

Conservatively maps an axis-aligned rectangle from this view&#39;s coordinate space into its parent coordinate space.

For non-translation transforms, an override must return the smallest parent-axis-aligned rectangle that encloses every transformed corner.

<a id="api-004764bf2e53b971"></a>

### [`View ScrollView.this[int index]`](#api-004764bf2e53b971)


```csharp
public override View this[int index] { get; }
```

Gets the child view at the given index.

<a id="api-fcb3e8e1c9c413e7"></a>

### [`Size ScrollView.MeasureCore(Size available, IMeasureContext context)`](#api-fcb3e8e1c9c413e7)


```csharp
protected override Size MeasureCore(Size available, IMeasureContext context);
```

Override to compute the desired border-edge size.

<a id="api-e868193e88019664"></a>

### [`void ScrollView.OnActivate()`](#api-e868193e88019664)


```csharp
protected override void OnActivate();
```

Called when this view becomes active — it will receive events, render, and animate. Override this to start animations, subscribe to data sources, or acquire resources.

<a id="api-8442b33fb9ade8b4"></a>

### [`void ScrollView.OnDeactivate()`](#api-8442b33fb9ade8b4)


```csharp
protected override void OnDeactivate();
```

Called when this view becomes dormant — it should stop animations, timers, and event subscriptions. The view may remain in the tree (e.g., in a virtualizing panel&#39;s recycle pool).

<a id="api-64d481576e47740a"></a>

### [`void ScrollView.OnPointerEvent(ref PointerEventRef e, EventPhase phase)`](#api-64d481576e47740a)


```csharp
public override void OnPointerEvent(ref PointerEventRef e, EventPhase phase);
```

Called during event dispatch to handle a pointer event in a specific event phase.

<a id="api-e00dc1fa94710435"></a>

### [`void ScrollView.OnScrollWheel(ref ScrollWheelEventRef e)`](#api-e00dc1fa94710435)


```csharp
public override void OnScrollWheel(ref ScrollWheelEventRef e);
```

Called when a scroll wheel or trackpad scroll event is dispatched to this view. Override to handle scroll input. Set [`Xui.Core.Abstract.Events.ScrollWheelEventRef.Handled`](../xui-core-abstract-events/index.md#api-e925616e42bc9886) to stop propagation.

<a id="api-38b275383fd48d5d"></a>

### [`View? ScrollView.Overlay`](#api-38b275383fd48d5d)


```csharp
public View? Overlay { get; set; }
```

A viewport-sized foreground view that stays outside the content&#39;s scroll transform. Its input still participates in this scroll view&#39;s gesture negotiation.

<a id="api-67b6e1ee7dd69ec0"></a>

### [`void ScrollView.RenderCore(IContext context)`](#api-67b6e1ee7dd69ec0)


```csharp
protected override void RenderCore(IContext context);
```

Override to render this view and its children.

<a id="api-9114fdc8435c7d42"></a>

### [`event Action<Vector>? ScrollView.ScrollChanged`](#api-9114fdc8435c7d42)


```csharp
public event Action<Vector>? ScrollChanged;
```

Raised after the content&#39;s scroll transform changes, including during inertia and rebound.

<a id="api-a788547a614c668b"></a>

### [`Vector ScrollView.ScrollOffset`](#api-a788547a614c668b)


```csharp
public Vector ScrollOffset { get; }
```

Current scroll displacement, including elastic overscroll.

<a id="api-7b393b31b912a009"></a>

### [`NFloat ScrollView.ScrollbarEndInset`](#api-7b393b31b912a009)


```csharp
public nfloat ScrollbarEndInset { get; set; }
```

Inset at each end of the scrollbar. When unset, adapts to the screen corners.

<a id="api-686ddd6196854f15"></a>

### [`NFloat ScrollView.ScrollbarWidth`](#api-686ddd6196854f15)


```csharp
public nfloat ScrollbarWidth { get; set; }
```

Width of the scrollbar track in points.

<a id="api-7ac5128ab46a4f99"></a>

### [`Point ScrollView.TransformPoint(Point point)`](#api-7ac5128ab46a4f99)


```csharp
public override Point TransformPoint(Point point);
```

Maps a point from this view&#39;s parent coordinate space into this view&#39;s local coordinate space.

Layout still supplies frames using the existing coordinate model. The default identity mapping deliberately preserves that behaviour until a container opts into a local coordinate transform. Containers such as [`Xui.Core.UI.ScrollView`](../xui-core-ui/index.md#api-bb441101c83090ab) can override this to map input into their content space.

<a id="api-34045ef2ed4d0c22"></a>

### [`Rect ScrollView.TransformRect(Rect rect)`](#api-34045ef2ed4d0c22)


```csharp
public override Rect TransformRect(Rect rect);
```

Conservatively maps an axis-aligned rectangle from this view&#39;s parent coordinate space into this view&#39;s coordinate space.

For non-translation transforms, an override must return the smallest parent-axis-aligned rectangle that encloses every transformed corner.

<a id="api-f60b99c21518f75f"></a>

### [`bool ScrollView.UseCompositionGroup`](#api-f60b99c21518f75f)


```csharp
public bool UseCompositionGroup { get; set; }
```

Retains this viewport as a native composition surface where supported.


<a id="api-7d69daddcd1aabf7"></a>

## `class TextBox`

A single-line text input view implemented as `LayerView<View, FocusBorderLayer<View, TextInputLayer>>`. All text editing state, selection, caret blinking, and hit-testing live in [`Xui.Core.UI.Layer.TextInputLayer`](../xui-core-ui-layer/index.md#api-58aad8df3817bd2a); focus-aware border drawing lives in [`Xui.Core.UI.Layer.FocusBorderLayer`2`](../xui-core-ui-layer/index.md#api-8e6472d2fd714f30).

```csharp
public class TextBox : LayerView<View, FocusBorderLayer<View, TextInputLayer>>, ITextEditingClient
{
    public override bool Focusable { get; }
    public TextInputOptions InputOptions { get; set; }

    public bool CanPerformInputAction(TextInputAction action);
    public void PerformInputAction(TextInputAction action);
    public Xui.Core.UI.Input.TextEditingState Editor { get; }
    public bool NativeSelection { get; set; }
    public Rect InputBounds { get; }

    public Rect GetCaretRect(int offset, ITextMeasureContext measure);
    public int GetTextPosition(Point point, ITextMeasureContext measure);
    public bool HasText { get; }

    protected override void OnDeactivate();
    public TextBox();
    public string Text { get; set; }
    public Interval<uint>.ClosedOpen Selection { get; set; }
    public bool IsPassword { get; set; }
    public bool SelectAllOnFocus { get; set; }
    public Func<char, bool>? InputFilter { get; set; }
    public Color Color { get; set; }
    public Color SelectedColor { get; set; }
    public Color SelectionBackgroundColor { get; set; }
    public Font Font { get; set; }
    public string FontFamily { get; set; }
    public nfloat FontSize { get; set; }
    public FontStyle FontStyle { get; set; }
    public FontWeight FontWeight { get; set; }
    public FontStretch FontStretch { get; set; }
}
```

<a id="api-c102d34d0fba4022"></a>

### [`TextBox.TextBox()`](#api-c102d34d0fba4022)


```csharp
public TextBox();
```

Initializes a new [`Xui.Core.UI.TextBox`](../xui-core-ui/index.md#api-7d69daddcd1aabf7) with default styling.

<a id="api-d10f0f23d63d9a32"></a>

### [`bool TextBox.CanPerformInputAction(TextInputAction action)`](#api-d10f0f23d63d9a32)


```csharp
public bool CanPerformInputAction(TextInputAction action);
```

Whether a keyboard action is currently available.

<a id="api-97eec9f4abda55a6"></a>

### [`Color TextBox.Color`](#api-97eec9f4abda55a6)


```csharp
public Color Color { get; set; }
```

Gets or sets the text color.

<a id="api-1c60700fc8cc70c4"></a>

### [`TextEditingState TextBox.Editor`](#api-1c60700fc8cc70c4)


```csharp
public Xui.Core.UI.Input.TextEditingState Editor { get; }
```

The document and selection shared with the native input system.

<a id="api-6738301dced4de2e"></a>

### [`bool TextBox.Focusable`](#api-6738301dced4de2e)


```csharp
public override bool Focusable { get; }
```

Gets whether this view can receive keyboard focus. Always `true` for [`Xui.Core.UI.TextBox`](../xui-core-ui/index.md#api-7d69daddcd1aabf7).

<a id="api-29a402c77f4e9001"></a>

### [`Font TextBox.Font`](#api-29a402c77f4e9001)


```csharp
public Font Font { get; set; }
```

Gets or sets the complete text font.

<a id="api-1cd01f5f31a2a0c6"></a>

### [`string TextBox.FontFamily`](#api-1cd01f5f31a2a0c6)


```csharp
public string FontFamily { get; set; }
```

Gets or sets the font family name.

<a id="api-e076b4f987e4d5b4"></a>

### [`NFloat TextBox.FontSize`](#api-e076b4f987e4d5b4)


```csharp
public nfloat FontSize { get; set; }
```

Gets or sets the font size.

<a id="api-e04bdb42e4882e8e"></a>

### [`FontStretch TextBox.FontStretch`](#api-e04bdb42e4882e8e)


```csharp
public FontStretch FontStretch { get; set; }
```

Gets or sets the font stretch.

<a id="api-52db11ec93c1bee9"></a>

### [`FontStyle TextBox.FontStyle`](#api-52db11ec93c1bee9)


```csharp
public FontStyle FontStyle { get; set; }
```

Gets or sets the font style.

<a id="api-7de67fac535ff1ad"></a>

### [`FontWeight TextBox.FontWeight`](#api-7de67fac535ff1ad)


```csharp
public FontWeight FontWeight { get; set; }
```

Gets or sets the font weight.

<a id="api-ee981af395792186"></a>

### [`Rect TextBox.GetCaretRect(int offset, ITextMeasureContext measure)`](#api-ee981af395792186)


```csharp
public Rect GetCaretRect(int offset, ITextMeasureContext measure);
```

Returns the caret rectangle for a UTF-16 offset, in logical window coordinates.

<a id="api-6184805946e86d17"></a>

### [`int TextBox.GetTextPosition(Point point, ITextMeasureContext measure)`](#api-6184805946e86d17)


```csharp
public int GetTextPosition(Point point, ITextMeasureContext measure);
```

Hit-tests a logical window point, returning a UTF-16 grapheme boundary.

<a id="api-0cc554f4d9b4aa6b"></a>

### [`bool TextBox.HasText`](#api-0cc554f4d9b4aa6b)


```csharp
public bool HasText { get; }
```

Whether the input contains any text.

<a id="api-4c3c083cf47f5bb8"></a>

### [`Rect TextBox.InputBounds`](#api-4c3c083cf47f5bb8)


```csharp
public Rect InputBounds { get; }
```

The input&#39;s hit-test bounds, in logical window coordinates.

<a id="api-c76567cba87e3857"></a>

### [`Func<char, bool>? TextBox.InputFilter`](#api-c76567cba87e3857)


```csharp
public Func<char, bool>? InputFilter { get; set; }
```

Gets or sets the character filter predicate for input validation.

<a id="api-8dcabd38f9fae995"></a>

### [`TextInputOptions TextBox.InputOptions`](#api-8dcabd38f9fae995)


```csharp
public TextInputOptions InputOptions { get; set; }
```

Keyboard hints, applied when this field receives focus.

<a id="api-520043b5e353a9aa"></a>

### [`bool TextBox.IsPassword`](#api-520043b5e353a9aa)


```csharp
public bool IsPassword { get; set; }
```

Gets or sets whether input is masked as a password.

<a id="api-2337e108c531fc4b"></a>

### [`bool TextBox.NativeSelection`](#api-2337e108c531fc4b)


```csharp
public bool NativeSelection { get; set; }
```

Whether a native interaction owns caret, selection handles, and touch selection.

<a id="api-93631360d0e3f843"></a>

### [`void TextBox.OnDeactivate()`](#api-93631360d0e3f843)


```csharp
protected override void OnDeactivate();
```

Called when this view becomes dormant — it should stop animations, timers, and event subscriptions. The view may remain in the tree (e.g., in a virtualizing panel&#39;s recycle pool).

<a id="api-b77f920ee573965d"></a>

### [`void TextBox.PerformInputAction(TextInputAction action)`](#api-b77f920ee573965d)


```csharp
public void PerformInputAction(TextInputAction action);
```

Handles a keyboard action, including focus navigation or finishing editing.

<a id="api-4771dee21f34b05c"></a>

### [`bool TextBox.SelectAllOnFocus`](#api-4771dee21f34b05c)


```csharp
public bool SelectAllOnFocus { get; set; }
```

Gets or sets whether all text is selected when the view receives focus.

<a id="api-65a085c229b62581"></a>

### [`Color TextBox.SelectedColor`](#api-65a085c229b62581)


```csharp
public Color SelectedColor { get; set; }
```

Gets or sets the color of selected text.

<a id="api-763c1cf349de2f20"></a>

### [`ClosedOpen TextBox.Selection`](#api-763c1cf349de2f20)


```csharp
public Interval<uint>.ClosedOpen Selection { get; set; }
```

Gets or sets the current text selection range.

<a id="api-ce42c0ee2943e56f"></a>

### [`Color TextBox.SelectionBackgroundColor`](#api-ce42c0ee2943e56f)


```csharp
public Color SelectionBackgroundColor { get; set; }
```

Gets or sets the background color of the selection.

<a id="api-bfae87c1e763181f"></a>

### [`string TextBox.Text`](#api-bfae87c1e763181f)


```csharp
public string Text { get; set; }
```

Gets or sets the text content of this input.


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

## `class TransformView`

Hosts one child and presents it through an affine transform without changing its layout rectangle. Input and render culling are mapped through the inverse transform so a translated or scaled child remains interactive and cullable.

```csharp
public class TransformView : View
{
    public bool UseCompositionGroup { get; set; }
    public View? Content { get; set; }
    public AffineTransform Transform { get; set; }
    public override int Count { get; }

    public override View this[int index] { get; }

    public override Rect CullingFrame { get; }

    public override Point TransformPoint(Point point);
    public override Point InverseTransformPoint(Point point);
    public override Rect TransformRect(Rect rect);
    public override Rect InverseTransformRect(Rect rect);
    public override bool HitTest(Point point);
    protected override void RenderCore(IContext context);
    protected virtual void RenderTransformedContent(IContext context);
}
```

<a id="api-06acf2896b2e1474"></a>

### [`View? TransformView.Content`](#api-06acf2896b2e1474)


```csharp
public View? Content { get; set; }
```

Gets or sets the single child presented by this host.

<a id="api-34820a2f7d14ce3d"></a>

### [`int TransformView.Count`](#api-34820a2f7d14ce3d)


```csharp
public override int Count { get; }
```

Returns the number of child views. Used by layout containers and traversal logic. Leaf views should return 0.

<a id="api-c23b1a4fe30fb07b"></a>

### [`Rect TransformView.CullingFrame`](#api-c23b1a4fe30fb07b)


```csharp
public override Rect CullingFrame { get; }
```

Gets this view&#39;s conservative bounds in its parent coordinate space for render culling.

A container may override this when its rendered geometry differs from its layout frame. Computing the union of descendant culling frames is deliberately deferred: it can be more expensive than rendering for small subtrees.

<a id="api-541953bca62463bf"></a>

### [`bool TransformView.HitTest(Point point)`](#api-541953bca62463bf)


```csharp
public override bool HitTest(Point point);
```

Determines whether the given point (in this view&#39;s local coordinates) hits this view&#39;s visual bounds. Used for input dispatch and hit testing.

- **`point`** — The point to test, relative to this view&#39;s coordinate space.

**Returns:** `true` if the point is inside the view&#39;s frame; otherwise `false`.

<a id="api-f9645298cb4991fc"></a>

### [`Point TransformView.InverseTransformPoint(Point point)`](#api-f9645298cb4991fc)


```csharp
public override Point InverseTransformPoint(Point point);
```

Maps a point from this view&#39;s local coordinate space into its parent coordinate space.

This must be the inverse of [`Xui.Core.UI.View.TransformPoint(Xui.Core.Math2D.Point)`](../xui-core-ui/index.md#api-624745fa8df45a58) for points that can be hit tested. It is separate so a view can support coordinate mappings that are not yet represented by the canvas transform API.

<a id="api-83bc2cf3352e187f"></a>

### [`Rect TransformView.InverseTransformRect(Rect rect)`](#api-83bc2cf3352e187f)


```csharp
public override Rect InverseTransformRect(Rect rect);
```

Conservatively maps an axis-aligned rectangle from this view&#39;s coordinate space into its parent coordinate space.

For non-translation transforms, an override must return the smallest parent-axis-aligned rectangle that encloses every transformed corner.

<a id="api-04fb743b6f5476f3"></a>

### [`View TransformView.this[int index]`](#api-04fb743b6f5476f3)


```csharp
public override View this[int index] { get; }
```

Indexer to access child views by index. Layout containers should implement this to expose their children.

<a id="api-21799363ab581b83"></a>

### [`void TransformView.RenderCore(IContext context)`](#api-21799363ab581b83)


```csharp
protected override void RenderCore(IContext context);
```

Override to render this view and its children.

<a id="api-cf2ac5d2a61f6e14"></a>

### [`void TransformView.RenderTransformedContent(IContext context)`](#api-cf2ac5d2a61f6e14)


```csharp
protected virtual void RenderTransformedContent(IContext context);
```

Renders content after [`Xui.Core.UI.TransformView.Transform`](../xui-core-ui/index.md#api-b36061483a129114) has been applied.

<a id="api-b36061483a129114"></a>

### [`AffineTransform TransformView.Transform`](#api-b36061483a129114)


```csharp
public AffineTransform Transform { get; set; }
```

Gets or sets the transform from this view&#39;s layout coordinates into its parent presentation coordinates.

<a id="api-2410a9d8793bd32c"></a>

### [`Point TransformView.TransformPoint(Point point)`](#api-2410a9d8793bd32c)


```csharp
public override Point TransformPoint(Point point);
```

Maps a point from this view&#39;s parent coordinate space into this view&#39;s local coordinate space.

Layout still supplies frames using the existing coordinate model. The default identity mapping deliberately preserves that behaviour until a container opts into a local coordinate transform. Containers such as [`Xui.Core.UI.ScrollView`](../xui-core-ui/index.md#api-bb441101c83090ab) can override this to map input into their content space.

<a id="api-b4866792c7f04739"></a>

### [`Rect TransformView.TransformRect(Rect rect)`](#api-b4866792c7f04739)


```csharp
public override Rect TransformRect(Rect rect);
```

Conservatively maps an axis-aligned rectangle from this view&#39;s parent coordinate space into this view&#39;s coordinate space.

For non-translation transforms, an override must return the smallest parent-axis-aligned rectangle that encloses every transformed corner.

<a id="api-e7a19e2c95feac9b"></a>

### [`bool TransformView.UseCompositionGroup`](#api-e7a19e2c95feac9b)


```csharp
public bool UseCompositionGroup { get; set; }
```

Retain the complete child drawing while only its native surface transform changes.


<a id="api-7f90709ad1004f80"></a>

## `enum VerticalAlignment`

Specifies how a view should be aligned vertically within its layout bounds. Used by parent containers to control vertical positioning along the block axis.

```csharp
public enum VerticalAlignment : byte
{
    Stretch = 0,
    Top = 1,
    Middle = 2,
    Bottom = 3
}
```

<a id="api-89203b44798c5bdd"></a>

### [`VerticalAlignment.Bottom`](#api-89203b44798c5bdd)


```csharp
Bottom = 3
```

Align to the bottom edge (or start edge in bottom-up layouts).

<a id="api-b61c9b44e1772d6a"></a>

### [`VerticalAlignment.Middle`](#api-b61c9b44e1772d6a)


```csharp
Middle = 2
```

Center vertically within the available space.

<a id="api-bfb37807628d0a6f"></a>

### [`VerticalAlignment.Stretch`](#api-bfb37807628d0a6f)


```csharp
Stretch = 0
```

Stretch to fill the full available vertical space.

<a id="api-f7a82e27d7ebc932"></a>

### [`VerticalAlignment.Top`](#api-f7a82e27d7ebc932)


```csharp
Top = 1
```

Align to the top edge (or start edge in top-down layouts).


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

## `class VerticalStack`

A layout container that arranges its children vertically from top to bottom. Each child is measured with an unconstrained height and is allowed to take up as much vertical space as needed. The container expands to fit the combined height of all children.

```csharp
public class VerticalStack : ViewCollection
{
    protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
    protected override void ArrangeCore(Rect rect, IMeasureContext context);
}
```

<a id="api-e298c41125a72f06"></a>

### [`void VerticalStack.ArrangeCore(Rect rect, IMeasureContext context)`](#api-e298c41125a72f06)


```csharp
protected override void ArrangeCore(Rect rect, IMeasureContext context);
```

Override to arrange children within this view&#39;s final frame.

<a id="api-faf764d058cc9c1c"></a>

### [`Size VerticalStack.MeasureCore(Size availableBorderEdgeSize, IMeasureContext context)`](#api-faf764d058cc9c1c)


```csharp
protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
```

Override to compute the desired border-edge size.


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

## `class VerticalUniformStack`

A layout container that arranges its children in a vertical stack, giving each child the same height.

If the parent provides a constrained height, the container divides the available height equally among all children.



If the height is unconstrained (infinite), the container measures each child to determine the maximum height, and uses that height for all rows.

```csharp
public class VerticalUniformStack : ViewCollection
{
    protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
    protected override void ArrangeCore(Rect rect, IMeasureContext context);
}
```

<a id="api-76695a2f58ff0fd4"></a>

### [`void VerticalUniformStack.ArrangeCore(Rect rect, IMeasureContext context)`](#api-76695a2f58ff0fd4)


```csharp
protected override void ArrangeCore(Rect rect, IMeasureContext context);
```

Override to arrange children within this view&#39;s final frame.

<a id="api-6fb23c8d22dc695d"></a>

### [`Size VerticalUniformStack.MeasureCore(Size availableBorderEdgeSize, IMeasureContext context)`](#api-6fb23c8d22dc695d)


```csharp
protected override Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
```

Override to compute the desired border-edge size.


<a id="api-0389f82d4babca03"></a>

## `class View`

Base class for all UI elements in the Xui layout engine. A view participates in layout, rendering, and input hit testing, and may contain child views.

Base class for all UI elements in the Xui layout engine. A view participates in layout, rendering, and input hit testing, and may contain child views.

```csharp
public partial class View : IServiceProvider, Layer.ILayerHost
{
    public virtual object? GetService(Type serviceType);
}
public partial class View
{
    public nint this[Extra<nint> key] { get; set; }

    public nfloat this[Extra<nfloat> key] { get; set; }

    public string? this[Extra<string?> key] { get; set; }

    public bool this[Extra<bool> key] { get; set; }

    public object? this[Extra key] { get; set; }

    public abstract class Extra
    {
    }

    public sealed class Extra<T> : Extra
    {
        public T DefaultValue { get; }

        public Extra(T defaultValue = default !);
        public T Get(View view);
    }
}
public partial class View
{
    protected internal virtual void OnFocus();
    protected internal virtual void OnBlur();
    public virtual bool Focusable { get; }
    public virtual bool RequiresKeyboard { get; }
    public bool IsFocused { get; }

    public bool Focus();
    public void Blur();
}
public partial class View
{
    public virtual int Count { get; }

    public virtual View this[int index] { get; }

    protected void AddProtectedChild(View child);
    protected void RemoveProtectedChild(View child);
    protected void SetProtectedChild<T>(ref T? field, T? value)
        where T : View;
}
public partial class View
{
    public virtual void OnPointerEvent(ref PointerEventRef e, EventPhase phase);
    public virtual void OnScrollWheel(ref ScrollWheelEventRef e);
    public virtual void OnZoom(ref ZoomEventRef e);
    public virtual void OnKeyDown(ref KeyEventRef e);
    public virtual void OnChar(ref KeyEventRef e);
}
public partial class View
{
    protected Rect? RenderCullingFrame { get; }

    public virtual void Update(in LayoutFrameContext frame, in LayoutUpdate update, ref LayoutMeasurements measurements);
    public void Animate(TimeSpan previousTime, TimeSpan currentTime);
    public Size Measure(Size availableSize, IMeasureContext context);
    public Rect Arrange(Rect rect, IMeasureContext context, Size? desiredSize = null);
    public void Render(IContext context);
    protected void AnimateShell(in LayoutFrameContext frame);
    protected void MeasureShell(in LayoutFrameContext frame, in MeasureConstraints constraints, ref LayoutMeasurements measurements);
    protected void ArrangeShell(in LayoutFrameContext frame, in ArrangeConstraints constraints, ref LayoutMeasurements measurements);
    protected void RenderShell(in LayoutFrameContext frame, Rect? parentCullingFrame = null);
    protected virtual void AnimateCore(TimeSpan previousTime, TimeSpan currentTime);
    protected virtual Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
    protected virtual void ArrangeCore(Rect rect, IMeasureContext context);
    protected virtual void RenderCore(IContext context);
    protected virtual void SetDefaultRenderState(IContext context);
    protected internal void RenderChild(IContext context, View child);
    protected internal void RenderChild(IContext context, View child, Rect cullingFrame);
}
public partial class View
{
    protected virtual void OnAttach(ref AttachEventRef e);
    protected virtual void OnDetach(ref DetachEventRef e);
    protected virtual void OnActivate();
    protected virtual void OnDeactivate();
}
public partial class View
{
    [Flags]
    public enum ViewFlags
    {
        Animated = 1 << 0,
        DescendantAnimated = 1 << 1,
        MeasureChanged = 1 << 2,
        ArrangeChanged = 1 << 3,
        DescendantArrangeChanged = 1 << 4,
        RenderChanged = 1 << 5,
        DescendantRenderChanged = 1 << 6,
        HitTestChanged = 1 << 7,
        DescendantHitTestChanged = 1 << 8,
        Active = 1 << 9,
        Attached = 1 << 10,
    }

    public ViewFlags Flags { get; }

    public bool RequiresRender(Xui.Core.Canvas.IContext context);
    protected bool HasRenderUpdates { get; }

    protected void Invalidate();
    protected bool SetViewProperty<T>(ref T field, T value);
    protected bool SetViewRenderProperty<T>(ref T field, T value);
    public void RequestAnimationFrame();
    protected virtual void OnChildRequestedAnimationFrame(View child);
    public void InvalidateMeasure();
    protected void InvalidateArrange();
    public void InvalidateRender();
    protected void InvalidateHitTest();
    public void ValidateMeasure();
    public void ValidateArrange();
    public void ValidateRender();
    public void ValidateHitTest();
    protected virtual void OnChildMeasureChanged(View child);
    protected virtual void OnChildArrangeChanged(View child);
    protected virtual void OnChildRenderChanged(View child);
    protected virtual void OnChildHitTestChanged(View child);
    public void CapturePointer(int pointerId, Xui.Core.UI.Input.IPointerGesture? gesture = null);
    public void ReleasePointer(int pointerId);
    public Xui.Core.UI.Input.IPointerGesture? GetCapturedGesture(int pointerId);
}
public partial class View
{
    public virtual Rect CullingFrame { get; }

    public virtual Point TransformPoint(Point point);
    public virtual Point InverseTransformPoint(Point point);
    public virtual Rect TransformRect(Rect rect);
    public virtual Rect InverseTransformRect(Rect rect);
    public Point LocalToGlobal(Point point);
    public Point GlobalToLocal(Point point);
}
public partial class View
{
    public string? Id { get; set; }

    public ClassNameCollection ClassName;
    public View? Parent { get; }
    public Rect Frame { get; protected set; }
    public Frame Margin { get; set; }
    public HorizontalAlignment HorizontalAlignment { get; set; }
    public VerticalAlignment VerticalAlignment { get; set; }
    public Direction Direction { get; set; }
    public WritingMode WritingMode { get; set; }
    public Flow Flow { get; set; }
    public nfloat MinimumWidth { get; set; }
    public nfloat MinimumHeight { get; set; }
    public nfloat MaximumWidth { get; set; }
    public nfloat MaximumHeight { get; set; }

    public virtual bool HitTest(Point point);
}
```

<a id="api-4f43d1a341e48474"></a>

### [`void View.AddProtectedChild(View child)`](#api-4f43d1a341e48474)


```csharp
protected void AddProtectedChild(View child);
```

Attaches a child view to this parent, setting Parent and performing basic validation. Intended for internal use by container views and single-child hosts.

<a id="api-5098e9e3dc38c4b6"></a>

### [`void View.Animate(TimeSpan previousTime, TimeSpan currentTime)`](#api-5098e9e3dc38c4b6)


```csharp
public void Animate(TimeSpan previousTime, TimeSpan currentTime);
```

Advances animation state for this view and all descendants.

<a id="api-bfe9b4c724686bcf"></a>

### [`void View.AnimateCore(TimeSpan previousTime, TimeSpan currentTime)`](#api-bfe9b4c724686bcf)


```csharp
protected virtual void AnimateCore(TimeSpan previousTime, TimeSpan currentTime);
```

Override to animate this view and its children.

<a id="api-7f1d1829f21a6396"></a>

### [`void View.AnimateShell(in LayoutFrameContext frame)`](#api-7f1d1829f21a6396)


```csharp
protected void AnimateShell(in LayoutFrameContext frame);
```

Performs bookkeeping and animation for this view.

<a id="api-b0526cf306e03823"></a>

### [`Rect View.Arrange(Rect rect, IMeasureContext context, Size? desiredSize = null)`](#api-b0526cf306e03823)


```csharp
public Rect Arrange(Rect rect, IMeasureContext context, Size? desiredSize = null);
```

Arranges the view within `rect`, finalising its position and size.

<a id="api-78047b58f4c94215"></a>

### [`void View.ArrangeCore(Rect rect, IMeasureContext context)`](#api-78047b58f4c94215)


```csharp
protected virtual void ArrangeCore(Rect rect, IMeasureContext context);
```

Override to arrange children within this view&#39;s final frame.

<a id="api-da90fde03cb352d3"></a>

### [`void View.ArrangeShell(in LayoutFrameContext frame, in ArrangeConstraints constraints, ref LayoutMeasurements measurements)`](#api-da90fde03cb352d3)


```csharp
protected void ArrangeShell(in LayoutFrameContext frame, in ArrangeConstraints constraints, ref LayoutMeasurements measurements);
```

Arranges this view using the supplied immutable constraints.

<a id="api-572c642e4f6a2418"></a>

### [`void View.Blur()`](#api-572c642e4f6a2418)


```csharp
public void Blur();
```

Releases keyboard focus from this view.

<a id="api-099817e1338ce09b"></a>

### [`void View.CapturePointer(int pointerId, IPointerGesture? gesture = null)`](#api-099817e1338ce09b)


```csharp
public void CapturePointer(int pointerId, Xui.Core.UI.Input.IPointerGesture? gesture = null);
```

Captures the pointer with the specified identifier so that it continues to receive pointer events even if the pointer moves outside its bounds.

- **`pointerId`** — The platform-assigned pointer identifier.

- **`gesture`** — Optional marker describing what kind of gesture this view is tracking (e.g. [`Xui.Core.UI.Input.PointerGestures.Tap`](../xui-core-ui-input/index.md#api-95067953a1ea6668) for a button, [`Xui.Core.UI.Input.PointerGestures.Drag`](../xui-core-ui-input/index.md#api-d27829d7c303b523) for a slider). Ancestor containers (e.g. `ScrollView`) inspect this via `EventRouter.GetCapturedGesture` to decide whether they may steal capture.

<a id="api-8648505ad7dce669"></a>

### [`ClassNameCollection View.ClassName`](#api-8648505ad7dce669)


```csharp
public ClassNameCollection ClassName;
```

The set of class names assigned to this view, used for lookup via [`Xui.Core.UI.ViewExtensions.FindViewsByClass(Xui.Core.UI.View,System.String,System.Collections.Generic.List{Xui.Core.UI.View})`](../xui-core-ui/index.md#api-52c4a0ceb427bc3a).

<a id="api-da755a65e8a8dc05"></a>

### [`int View.Count`](#api-da755a65e8a8dc05)


```csharp
public virtual int Count { get; }
```

Returns the number of child views. Used by layout containers and traversal logic. Leaf views should return 0.

<a id="api-74a44b3da2d8940b"></a>

### [`Rect View.CullingFrame`](#api-74a44b3da2d8940b)


```csharp
public virtual Rect CullingFrame { get; }
```

Gets this view&#39;s conservative bounds in its parent coordinate space for render culling.

A container may override this when its rendered geometry differs from its layout frame. Computing the union of descendant culling frames is deliberately deferred: it can be more expensive than rendering for small subtrees.

<a id="api-92ee855f0e130cb0"></a>

### [`Direction View.Direction`](#api-92ee855f0e130cb0)


```csharp
public Direction Direction { get; set; }
```

Gets or sets the writing direction.

<a id="api-56b928b30b8f338a"></a>

### [`ViewFlags View.Flags`](#api-56b928b30b8f338a)


```csharp
public ViewFlags Flags { get; }
```

Gets the current change flags for this view. These flags indicate which aspects (measure, arrange, render, hit test) have changed since the last time the parent acknowledged them via the corresponding Validate* method.

<a id="api-7040b7068cfa192d"></a>

### [`Flow View.Flow`](#api-7040b7068cfa192d)


```csharp
public Flow Flow { get; set; }
```

Gets or sets the child flow behavior.

<a id="api-a5e6903072fa79c2"></a>

### [`bool View.Focus()`](#api-a5e6903072fa79c2)


```csharp
public bool Focus();
```

Requests keyboard focus for this view.

<a id="api-ed576b48f7b5a158"></a>

### [`bool View.Focusable`](#api-ed576b48f7b5a158)


```csharp
public virtual bool Focusable { get; }
```

Gets whether this view can receive keyboard focus via Tab navigation.

<a id="api-5f4c8ba7c29bdfd0"></a>

### [`Rect View.Frame`](#api-5f4c8ba7c29bdfd0)


```csharp
public Rect Frame { get; protected set; }
```

The border edge of this view in global coordinates relative to the top-left of the window.

<a id="api-16bfd2d7004f3e3a"></a>

### [`IPointerGesture? View.GetCapturedGesture(int pointerId)`](#api-16bfd2d7004f3e3a)


```csharp
public Xui.Core.UI.Input.IPointerGesture? GetCapturedGesture(int pointerId);
```

Returns the gesture marker for the view currently capturing `pointerId`, or `null` if the pointer is not captured or was captured without a gesture marker.

<a id="api-b2707b1b00f98008"></a>

### [`object? View.GetService(Type serviceType)`](#api-b2707b1b00f98008)


```csharp
public virtual object? GetService(Type serviceType);
```

Resolves a service of the given type by walking up the parent chain. Returns `null` if no ancestor provides the service.

<a id="api-7f21543eb7c27dc7"></a>

### [`Point View.GlobalToLocal(Point point)`](#api-7f21543eb7c27dc7)


```csharp
public Point GlobalToLocal(Point point);
```

Maps a point in root/window coordinate space into this view&#39;s local coordinate space.

<a id="api-6398e1aad8e03065"></a>

### [`bool View.HasRenderUpdates`](#api-6398e1aad8e03065)


```csharp
protected bool HasRenderUpdates { get; }
```

Whether this view or its descendants have graphics updates for the current render. Unlike Flags, this remains available inside RenderCore after the render shell clears the incoming invalidation flags. Suitable for GroupOptions.HasUpdates; the context still decides whether content must be drawn, including on first use or SVG export.

<a id="api-b91d4c95c4df4640"></a>

### [`bool View.HitTest(Point point)`](#api-b91d4c95c4df4640)


```csharp
public virtual bool HitTest(Point point);
```

Determines whether the given point (in this view&#39;s local coordinates) hits this view&#39;s visual bounds. Used for input dispatch and hit testing.

- **`point`** — The point to test, relative to this view&#39;s coordinate space.

**Returns:** `true` if the point is inside the view&#39;s frame; otherwise `false`.

<a id="api-8a1b2ba36be480c8"></a>

### [`HorizontalAlignment View.HorizontalAlignment`](#api-8a1b2ba36be480c8)


```csharp
public HorizontalAlignment HorizontalAlignment { get; set; }
```

Gets or sets the horizontal alignment within the layout anchor region.

<a id="api-d2331247a4581d73"></a>

### [`string? View.Id`](#api-d2331247a4581d73)


```csharp
public string? Id { get; set; }
```

An optional unique identifier for this view, used for lookup via [`Xui.Core.UI.ViewExtensions.FindViewById(Xui.Core.UI.View,System.String)`](../xui-core-ui/index.md#api-c02e20b4292c96fe).

<a id="api-d89c16e8db1d6639"></a>

### [`void View.Invalidate()`](#api-d89c16e8db1d6639)


```csharp
protected void Invalidate();
```

Invalidates every phase affected by a change to the view&#39;s layout contract. Used by the base layout properties so cached measurements cannot survive a change to constraints, alignment, or spacing.

<a id="api-b405ad51360a5d98"></a>

### [`void View.InvalidateArrange()`](#api-b405ad51360a5d98)


```csharp
protected void InvalidateArrange();
```

Marks this view as having changed in a way that may cause it to arrange its children differently, even with the same rectangle and context. Causes [`Xui.Core.UI.View.OnChildArrangeChanged(Xui.Core.UI.View)`](../xui-core-ui/index.md#api-8a2e55c4818a54ab) to be invoked on the parent.

<a id="api-5b9c55fd84879107"></a>

### [`void View.InvalidateHitTest()`](#api-5b9c55fd84879107)


```csharp
protected void InvalidateHitTest();
```

Marks this view as having changed in a way that may cause hit testing to yield different results, even for the same input coordinates. Causes [`Xui.Core.UI.View.OnChildHitTestChanged(Xui.Core.UI.View)`](../xui-core-ui/index.md#api-22b4e9de84df2c3d) to be invoked on the parent.

<a id="api-14afad2bb41d29c1"></a>

### [`void View.InvalidateMeasure()`](#api-14afad2bb41d29c1)


```csharp
public void InvalidateMeasure();
```

Marks this view as having changed in a way that may affect its measured size. Causes [`Xui.Core.UI.View.OnChildMeasureChanged(Xui.Core.UI.View)`](../xui-core-ui/index.md#api-c2e01bccad9e8e01) to be invoked on the parent.

<a id="api-38e13032e74cfcfb"></a>

### [`void View.InvalidateRender()`](#api-38e13032e74cfcfb)


```csharp
public void InvalidateRender();
```

Marks this view as having changed visually in a way that requires re-rendering. Causes [`Xui.Core.UI.View.OnChildRenderChanged(Xui.Core.UI.View)`](../xui-core-ui/index.md#api-17788c4cfb60d56f) to be invoked on the parent.

<a id="api-146b5ac3c61cfb75"></a>

### [`Point View.InverseTransformPoint(Point point)`](#api-146b5ac3c61cfb75)


```csharp
public virtual Point InverseTransformPoint(Point point);
```

Maps a point from this view&#39;s local coordinate space into its parent coordinate space.

This must be the inverse of [`Xui.Core.UI.View.TransformPoint(Xui.Core.Math2D.Point)`](../xui-core-ui/index.md#api-624745fa8df45a58) for points that can be hit tested. It is separate so a view can support coordinate mappings that are not yet represented by the canvas transform API.

<a id="api-17d5fee4253fd6b5"></a>

### [`Rect View.InverseTransformRect(Rect rect)`](#api-17d5fee4253fd6b5)


```csharp
public virtual Rect InverseTransformRect(Rect rect);
```

Conservatively maps an axis-aligned rectangle from this view&#39;s coordinate space into its parent coordinate space.

For non-translation transforms, an override must return the smallest parent-axis-aligned rectangle that encloses every transformed corner.

<a id="api-3351e9711ec96b4e"></a>

### [`bool View.IsFocused`](#api-3351e9711ec96b4e)


```csharp
public bool IsFocused { get; }
```

Gets whether this view currently has keyboard focus.

<a id="api-026ce0d6499bb0bb"></a>

### [`View View.this[int index]`](#api-026ce0d6499bb0bb)


```csharp
public virtual View this[int index] { get; }
```

Indexer to access child views by index. Layout containers should implement this to expose their children.

<a id="api-0aeb5f8214a86f3b"></a>

### [`object? View.this[Extra key]`](#api-0aeb5f8214a86f3b)


```csharp
public object? this[Extra key] { get; set; }
```

Fallback indexer for extras whose value type is not covered by a typed overload (e.g. enums). Values are boxed. Prefer the typed overloads for `System.IntPtr`, `System.Runtime.InteropServices.NFloat`, `System.String`, and `System.Boolean` where possible.

<a id="api-df0bf0e4313ae06e"></a>

### [`bool View.this[Extra<bool> key]`](#api-df0bf0e4313ae06e)


```csharp
public bool this[Extra<bool> key] { get; set; }
```

Gets or sets a `System.Boolean` extra on this view.

<a id="api-cd206684551a9ccb"></a>

### [`nint View.this[Extra<nint> key]`](#api-cd206684551a9ccb)


```csharp
public nint this[Extra<nint> key] { get; set; }
```

Gets or sets an `System.IntPtr` extra on this view.

<a id="api-fbb6be08f8e3c860"></a>

### [`NFloat View.this[Extra<NFloat> key]`](#api-fbb6be08f8e3c860)


```csharp
public nfloat this[Extra<nfloat> key] { get; set; }
```

Gets or sets an `System.Runtime.InteropServices.NFloat` extra on this view.

<a id="api-7720f16a9893fed4"></a>

### [`string? View.this[Extra<string?> key]`](#api-7720f16a9893fed4)


```csharp
public string? this[Extra<string?> key] { get; set; }
```

Gets or sets a `System.String` extra on this view.

<a id="api-9674a3a0946407c1"></a>

### [`Point View.LocalToGlobal(Point point)`](#api-9674a3a0946407c1)


```csharp
public Point LocalToGlobal(Point point);
```

Maps a point in this view&#39;s local coordinate space into root/window coordinate space.

<a id="api-6b345cd45c76bca1"></a>

### [`Frame View.Margin`](#api-6b345cd45c76bca1)


```csharp
public Frame Margin { get; set; }
```

Gets or sets the external spacing around the view.

<a id="api-9e3d16639a93efde"></a>

### [`NFloat View.MaximumHeight`](#api-9e3d16639a93efde)


```csharp
public nfloat MaximumHeight { get; set; }
```

Gets or sets the maximum border-edge height.

<a id="api-f8e9b72beb08032c"></a>

### [`NFloat View.MaximumWidth`](#api-f8e9b72beb08032c)


```csharp
public nfloat MaximumWidth { get; set; }
```

Gets or sets the maximum border-edge width.

<a id="api-c4380b7c0efe15c4"></a>

### [`Size View.Measure(Size availableSize, IMeasureContext context)`](#api-c4380b7c0efe15c4)


```csharp
public Size Measure(Size availableSize, IMeasureContext context);
```

Measures the view and returns the desired margin-box size.

<a id="api-61a2fb9108449e1c"></a>

### [`Size View.MeasureCore(Size availableBorderEdgeSize, IMeasureContext context)`](#api-61a2fb9108449e1c)


```csharp
protected virtual Size MeasureCore(Size availableBorderEdgeSize, IMeasureContext context);
```

Override to compute the desired border-edge size.

<a id="api-547c7d675d01ad08"></a>

### [`void View.MeasureShell(in LayoutFrameContext frame, in MeasureConstraints constraints, ref LayoutMeasurements measurements)`](#api-547c7d675d01ad08)


```csharp
protected void MeasureShell(in LayoutFrameContext frame, in MeasureConstraints constraints, ref LayoutMeasurements measurements);
```

Measures this view using the supplied immutable constraints.

<a id="api-ffd8ddae5b403947"></a>

### [`NFloat View.MinimumHeight`](#api-ffd8ddae5b403947)


```csharp
public nfloat MinimumHeight { get; set; }
```

Gets or sets the minimum border-edge height.

<a id="api-ad790ac838618a79"></a>

### [`NFloat View.MinimumWidth`](#api-ad790ac838618a79)


```csharp
public nfloat MinimumWidth { get; set; }
```

Gets or sets the minimum border-edge width.

<a id="api-0d4a932712301b9f"></a>

### [`void View.OnActivate()`](#api-0d4a932712301b9f)


```csharp
protected virtual void OnActivate();
```

Called when this view becomes active — it will receive events, render, and animate. Override this to start animations, subscribe to data sources, or acquire resources.

<a id="api-a7a7da932e1a6cf9"></a>

### [`void View.OnAttach(ref AttachEventRef e)`](#api-a7a7da932e1a6cf9)


```csharp
protected virtual void OnAttach(ref AttachEventRef e);
```

Called when this view is added to the visual tree and platform contexts become available. Override to acquire resources that depend on text measurement or bitmap factories.

<a id="api-495b845ed71068e3"></a>

### [`void View.OnBlur()`](#api-495b845ed71068e3)


```csharp
protected internal virtual void OnBlur();
```

Called when this view loses keyboard focus.

<a id="api-dfad90cfd53f0e64"></a>

### [`void View.OnChar(ref KeyEventRef e)`](#api-dfad90cfd53f0e64)


```csharp
public virtual void OnChar(ref KeyEventRef e);
```

Called when a character is input while this view has focus.

<a id="api-8a2e55c4818a54ab"></a>

### [`void View.OnChildArrangeChanged(View child)`](#api-8a2e55c4818a54ab)


```csharp
protected virtual void OnChildArrangeChanged(View child);
```

Called when a direct or indirect child view has changed in a way that may affect its arrangement of children. The default implementation forwards the notification up the visual tree to the parent.

- **`child`** — The child view whose arrange state has changed.

<a id="api-22b4e9de84df2c3d"></a>

### [`void View.OnChildHitTestChanged(View child)`](#api-22b4e9de84df2c3d)


```csharp
protected virtual void OnChildHitTestChanged(View child);
```

Called when a direct or indirect child view has changed in a way that may cause hit testing results to change. The default implementation forwards the notification up the visual tree to the parent.

- **`child`** — The child view whose hit testing state has changed.

<a id="api-c2e01bccad9e8e01"></a>

### [`void View.OnChildMeasureChanged(View child)`](#api-c2e01bccad9e8e01)


```csharp
protected virtual void OnChildMeasureChanged(View child);
```

Called when a direct or indirect child view has changed in a way that may affect its measured size. The default implementation forwards the notification up the visual tree to the parent.

- **`child`** — The child view whose measure state has changed.

<a id="api-17788c4cfb60d56f"></a>

### [`void View.OnChildRenderChanged(View child)`](#api-17788c4cfb60d56f)


```csharp
protected virtual void OnChildRenderChanged(View child);
```

Called when a direct or indirect child view has changed visually and requires re-rendering. The default implementation forwards the notification up the visual tree.

- **`child`** — The child view whose render state has changed.

<a id="api-a713a8ac4ad22c83"></a>

### [`void View.OnChildRequestedAnimationFrame(View child)`](#api-a713a8ac4ad22c83)


```csharp
protected virtual void OnChildRequestedAnimationFrame(View child);
```

Called when a direct or indirect child has requested another animation frame for the next UI tick. The default implementation marks [`Xui.Core.UI.View.ViewFlags.DescendantAnimated`](../xui-core-ui/index.md#api-e3510589848f73b8) and forwards the notification up the visual tree.

- **`child`** — The child view that requested the animation frame.

<a id="api-cb039660c126ea95"></a>

### [`void View.OnDeactivate()`](#api-cb039660c126ea95)


```csharp
protected virtual void OnDeactivate();
```

Called when this view becomes dormant — it should stop animations, timers, and event subscriptions. The view may remain in the tree (e.g., in a virtualizing panel&#39;s recycle pool).

<a id="api-90c9ac8ec8230a8f"></a>

### [`void View.OnDetach(ref DetachEventRef e)`](#api-90c9ac8ec8230a8f)


```csharp
protected virtual void OnDetach(ref DetachEventRef e);
```

Called when this view is removed from the visual tree. Override to release any resources acquired in [`Xui.Core.UI.View.OnAttach(Xui.Core.UI.AttachEventRef@)`](../xui-core-ui/index.md#api-a7a7da932e1a6cf9).

<a id="api-941e3579eb5a6d53"></a>

### [`void View.OnFocus()`](#api-941e3579eb5a6d53)


```csharp
protected internal virtual void OnFocus();
```

Called when this view receives keyboard focus.

<a id="api-ef82dfae4a8898ed"></a>

### [`void View.OnKeyDown(ref KeyEventRef e)`](#api-ef82dfae4a8898ed)


```csharp
public virtual void OnKeyDown(ref KeyEventRef e);
```

Called when a key is pressed while this view has focus.

<a id="api-872f5db64136e78b"></a>

### [`void View.OnPointerEvent(ref PointerEventRef e, EventPhase phase)`](#api-872f5db64136e78b)


```csharp
public virtual void OnPointerEvent(ref PointerEventRef e, EventPhase phase);
```

Called during event dispatch to handle a pointer event in a specific event phase.

<a id="api-1a799f4f4c23ce75"></a>

### [`void View.OnScrollWheel(ref ScrollWheelEventRef e)`](#api-1a799f4f4c23ce75)


```csharp
public virtual void OnScrollWheel(ref ScrollWheelEventRef e);
```

Called when a scroll wheel or trackpad scroll event is dispatched to this view. Override to handle scroll input. Set [`Xui.Core.Abstract.Events.ScrollWheelEventRef.Handled`](../xui-core-abstract-events/index.md#api-e925616e42bc9886) to stop propagation.

<a id="api-45b39b6fb17c3f03"></a>

### [`void View.OnZoom(ref ZoomEventRef e)`](#api-45b39b6fb17c3f03)


```csharp
public virtual void OnZoom(ref ZoomEventRef e);
```

Handles a platform magnification gesture. Set Handled to stop bubbling.

<a id="api-0e93dc7cd71d6633"></a>

### [`View? View.Parent`](#api-0e93dc7cd71d6633)


```csharp
public View? Parent { get; }
```

The parent view in the visual hierarchy. This is set automatically when the view is added to a container.

<a id="api-5f44734eca12d3e0"></a>

### [`void View.ReleasePointer(int pointerId)`](#api-5f44734eca12d3e0)


```csharp
public void ReleasePointer(int pointerId);
```

Releases a previously captured pointer so that pointer events are routed according to normal hit testing rules.

- **`pointerId`** — The platform-assigned pointer identifier.

<a id="api-d7b7d498ad443b25"></a>

### [`void View.RemoveProtectedChild(View child)`](#api-d7b7d498ad443b25)


```csharp
protected void RemoveProtectedChild(View child);
```

Detaches a child view from this parent, clearing Parent. Intended for internal use by container views and single-child hosts.

<a id="api-103a67f5da2e985f"></a>

### [`void View.Render(IContext context)`](#api-103a67f5da2e985f)


```csharp
public void Render(IContext context);
```

Renders the view. Must be called after layout is complete.

<a id="api-2a4a2ba3d992e196"></a>

### [`void View.RenderChild(IContext context, View child)`](#api-2a4a2ba3d992e196)


```csharp
protected internal void RenderChild(IContext context, View child);
```

Renders a child while preserving this view&#39;s active culling rectangle.

<a id="api-e2c2e44b1810f3fd"></a>

### [`void View.RenderChild(IContext context, View child, Rect cullingFrame)`](#api-e2c2e44b1810f3fd)


```csharp
protected internal void RenderChild(IContext context, View child, Rect cullingFrame);
```

Renders a child using an explicit culling rectangle in this view&#39;s coordinate space.

<a id="api-8b78f8e9e0f73a3a"></a>

### [`void View.RenderCore(IContext context)`](#api-8b78f8e9e0f73a3a)


```csharp
protected virtual void RenderCore(IContext context);
```

Override to render this view and its children.

<a id="api-1bcf66db3192c464"></a>

### [`Rect? View.RenderCullingFrame`](#api-1bcf66db3192c464)


```csharp
protected Rect? RenderCullingFrame { get; }
```

The active render culling rectangle in this view&#39;s coordinate space, if any.

<a id="api-1d6eb81014b8827a"></a>

### [`void View.RenderShell(in LayoutFrameContext frame, Rect? parentCullingFrame = null)`](#api-1d6eb81014b8827a)


```csharp
protected void RenderShell(in LayoutFrameContext frame, Rect? parentCullingFrame = null);
```

Performs bookkeeping and renders this view.

<a id="api-0cb1c1f63a3f65ad"></a>

### [`void View.RequestAnimationFrame()`](#api-0cb1c1f63a3f65ad)


```csharp
public void RequestAnimationFrame();
```

Requests another animation frame for this view on the next UI tick. Sets [`Xui.Core.UI.View.ViewFlags.Animated`](../xui-core-ui/index.md#api-d0bc0a8188408ca3) and notifies ancestors (via [`Xui.Core.UI.View.OnChildRequestedAnimationFrame(Xui.Core.UI.View)`](../xui-core-ui/index.md#api-a713a8ac4ad22c83)) so they carry [`Xui.Core.UI.View.ViewFlags.DescendantAnimated`](../xui-core-ui/index.md#api-e3510589848f73b8).

<a id="api-a64a8346ce090af2"></a>

### [`bool View.RequiresKeyboard`](#api-a64a8346ce090af2)


```csharp
public virtual bool RequiresKeyboard { get; }
```

Whether focusing this view requests the platform&#39;s software keyboard.

<a id="api-74bc179617615877"></a>

### [`bool View.RequiresRender(IContext context)`](#api-74bc179617615877)


```csharp
public bool RequiresRender(Xui.Core.Canvas.IContext context);
```

Whether graphics changed, or this view last rendered into a different context.

Use when declaring a retained child surface before calling the child&#39;s Render method.

<a id="api-139d7631b86bedd6"></a>

### [`void View.SetDefaultRenderState(IContext context)`](#api-139d7631b86bedd6)


```csharp
protected virtual void SetDefaultRenderState(IContext context);
```

Applies the drawing defaults used at the start of every view render. The active transform and clip are intentionally inherited from the parent.

<a id="api-427acb85419238ae"></a>

### [`void View.SetProtectedChild<T>(ref T? field, T? value)`](#api-427acb85419238ae)


```csharp
protected void SetProtectedChild<T>(ref T? field, T? value)
    where T : View;
```

Sets a single protected child field, automatically detaching the old child (if any) and attaching the new child (if any). Use this for single-child containers.

<a id="api-61f4bc0cd77ad054"></a>

### [`bool View.SetViewProperty<T>(ref T field, T value)`](#api-61f4bc0cd77ad054)


```csharp
protected bool SetViewProperty<T>(ref T field, T value);
```

Assigns a layout-affecting property when its value changes, then invalidates the view&#39;s measure, arrange, and render state.

**Returns:** `true` when `field` changed.

<a id="api-c10b34f2d690801b"></a>

### [`bool View.SetViewRenderProperty<T>(ref T field, T value)`](#api-c10b34f2d690801b)


```csharp
protected bool SetViewRenderProperty<T>(ref T field, T value);
```

Assigns a render-only property when its value changes.

**Returns:** `true` when `field` changed.

<a id="api-624745fa8df45a58"></a>

### [`Point View.TransformPoint(Point point)`](#api-624745fa8df45a58)


```csharp
public virtual Point TransformPoint(Point point);
```

Maps a point from this view&#39;s parent coordinate space into this view&#39;s local coordinate space.

Layout still supplies frames using the existing coordinate model. The default identity mapping deliberately preserves that behaviour until a container opts into a local coordinate transform. Containers such as [`Xui.Core.UI.ScrollView`](../xui-core-ui/index.md#api-bb441101c83090ab) can override this to map input into their content space.

<a id="api-ffc91d8a642f3269"></a>

### [`Rect View.TransformRect(Rect rect)`](#api-ffc91d8a642f3269)


```csharp
public virtual Rect TransformRect(Rect rect);
```

Conservatively maps an axis-aligned rectangle from this view&#39;s parent coordinate space into this view&#39;s coordinate space.

For non-translation transforms, an override must return the smallest parent-axis-aligned rectangle that encloses every transformed corner.

<a id="api-114be7178c9388be"></a>

### [`void View.Update(in LayoutFrameContext frame, in LayoutUpdate update, ref LayoutMeasurements measurements)`](#api-114be7178c9388be)


```csharp
public virtual void Update(in LayoutFrameContext frame, in LayoutUpdate update, ref LayoutMeasurements measurements);
```

Drives the requested passes using shared frame state and per-view constraints.

<a id="api-e533af2b3c1b573f"></a>

### [`void View.ValidateArrange()`](#api-e533af2b3c1b573f)


```csharp
public void ValidateArrange();
```

Clears the [`Xui.Core.UI.View.ViewFlags.ArrangeChanged`](../xui-core-ui/index.md#api-5f84a95688318291) flag on this view, indicating that a parent or container has acknowledged the child’s arrange change.

<a id="api-fa5277396229fa37"></a>

### [`void View.ValidateHitTest()`](#api-fa5277396229fa37)


```csharp
public void ValidateHitTest();
```

Clears the [`Xui.Core.UI.View.ViewFlags.HitTestChanged`](../xui-core-ui/index.md#api-03994e1cc9783583) flag on this view, indicating that hit-test caches (if any) have been updated or the parent has otherwise accounted for the changed hit-test behavior.

<a id="api-62948173caf3537a"></a>

### [`void View.ValidateMeasure()`](#api-62948173caf3537a)


```csharp
public void ValidateMeasure();
```

Clears the [`Xui.Core.UI.View.ViewFlags.MeasureChanged`](../xui-core-ui/index.md#api-8801ade6468761a5) flag on this view, indicating that a parent or container has acknowledged the child’s measure change and handled it (e.g., decided to keep the same column width in a grid regardless of the child’s new desired size). Use this when the parent has considered the change and no re-measure is required for this child.

<a id="api-32e0e2cf2eda8253"></a>

### [`void View.ValidateRender()`](#api-32e0e2cf2eda8253)


```csharp
public void ValidateRender();
```

Clears the [`Xui.Core.UI.View.ViewFlags.RenderChanged`](../xui-core-ui/index.md#api-f563279cb5f5c4f3) flag on this view, indicating that the parent (or the rendering pipeline) has acknowledged the visual change and re-rendering for this view has been completed.

<a id="api-2b8bee5bf9a8513d"></a>

### [`VerticalAlignment View.VerticalAlignment`](#api-2b8bee5bf9a8513d)


```csharp
public VerticalAlignment VerticalAlignment { get; set; }
```

Gets or sets the vertical alignment within the layout anchor region.

<a id="api-1c7bcf59a270fec4"></a>

### [`WritingMode View.WritingMode`](#api-1c7bcf59a270fec4)


```csharp
public WritingMode WritingMode { get; set; }
```

Gets or sets the writing mode.


<a id="api-5a849cb74e86a6d1"></a>

## `class View.Extra`

Non-generic base for [`Xui.Core.UI.View.Extra`1`](../xui-core-ui/index.md#api-ed6bc14fbf8104d5). Used as a dictionary key when storage is implemented.

```csharp
public abstract class Extra
{
}
```


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

## `class View.Extra<T>`

A typed key for attaching extra layout or styling data to any [`Xui.Core.UI.View`](../xui-core-ui/index.md#api-0389f82d4babca03). Declare one static instance per logical property (e.g. `Grid.Row`, `FlexBox.Grow`) and use it with the view indexer: `view[Grid.Row] = 2`.

- **`T`** — The type of the value stored under this key.

```csharp
public sealed class Extra<T> : Extra
{
    public T DefaultValue { get; }

    public Extra(T defaultValue = default !);
    public T Get(View view);
}
```

<a id="api-c7153f4f39cb22c9"></a>

### [`Extra<T>.Extra(T defaultValue = default(T))`](#api-c7153f4f39cb22c9)


```csharp
public Extra(T defaultValue = default !);
```

- **`defaultValue`** — Returned by the indexer getter until a value is explicitly set.

<a id="api-d9dce69a79e2ce6c"></a>

### [`T Extra<T>.DefaultValue`](#api-d9dce69a79e2ce6c)


```csharp
public T DefaultValue { get; }
```

The value returned when no data has been stored for this key on a given view.

<a id="api-a5174f761cd75a68"></a>

### [`T Extra<T>.Get(View view)`](#api-a5174f761cd75a68)


```csharp
public T Get(View view);
```

Returns the value stored for this key on `view`, or [`Xui.Core.UI.View.Extra`1.DefaultValue`](../xui-core-ui/index.md#api-d9dce69a79e2ce6c) if nothing has been set.


<a id="api-528f3e45b986486f"></a>

## `enum View.ViewFlags`

Flags used internally by a [`Xui.Core.UI.View`](../xui-core-ui/index.md#api-0389f82d4babca03) to track invalidation state across measure, arrangement, rendering, and hit testing phases. These flags allow the framework to selectively recompute only dirty subtrees during recursive passes.

```csharp
[Flags]
public enum ViewFlags
{
    Animated = 1 << 0,
    DescendantAnimated = 1 << 1,
    MeasureChanged = 1 << 2,
    ArrangeChanged = 1 << 3,
    DescendantArrangeChanged = 1 << 4,
    RenderChanged = 1 << 5,
    DescendantRenderChanged = 1 << 6,
    HitTestChanged = 1 << 7,
    DescendantHitTestChanged = 1 << 8,
    Active = 1 << 9,
    Attached = 1 << 10,
}
```

<a id="api-3bd9d28b8eeb0491"></a>

### [`ViewFlags.Active`](#api-3bd9d28b8eeb0491)


```csharp
Active = 1 << 9
```

This view is active — it is part of a live visual tree and will receive events, render, and animate. Set by `Xui.Core.UI.View.ActivateSubtree(Xui.Core.UI.View)` and cleared by `Xui.Core.UI.View.DeactivateSubtree(Xui.Core.UI.View)`.

<a id="api-d0bc0a8188408ca3"></a>

### [`ViewFlags.Animated`](#api-d0bc0a8188408ca3)


```csharp
Animated = 1 << 0
```

This view is animated. It has properties that are calculated based on the current UI time. It requires an animation notification on the next frame.

<a id="api-5f84a95688318291"></a>

### [`ViewFlags.ArrangeChanged`](#api-5f84a95688318291)


```csharp
ArrangeChanged = 1 << 3
```

The [`Xui.Core.UI.View`](../xui-core-ui/index.md#api-0389f82d4babca03) has changed in a way that may cause it to arrange its children differently, even if the available rectangle and measure context are the same.

<a id="api-fd91c9dc7e4b6725"></a>

### [`ViewFlags.Attached`](#api-fd91c9dc7e4b6725)


```csharp
Attached = 1 << 10
```

This view is attached — it has been added to a visual tree that is itself attached to the platform (e.g. a window). Set by `Xui.Core.UI.View.AttachSubtree(Xui.Core.UI.View,Xui.Core.UI.AttachEventRef@)` and cleared by `Xui.Core.UI.View.DetachSubtree(Xui.Core.UI.View,Xui.Core.UI.DetachEventRef@)`.

<a id="api-e3510589848f73b8"></a>

### [`ViewFlags.DescendantAnimated`](#api-e3510589848f73b8)


```csharp
DescendantAnimated = 1 << 1
```

This view has animated children. While this view directly does not depend on the next frame time, it must propagate an animation notification to its animated children.

<a id="api-4b798302d4871620"></a>

### [`ViewFlags.DescendantArrangeChanged`](#api-4b798302d4871620)


```csharp
DescendantArrangeChanged = 1 << 4
```

One or more descendants of this [`Xui.Core.UI.View`](../xui-core-ui/index.md#api-0389f82d4babca03) have had their [`Xui.Core.UI.View.ViewFlags.ArrangeChanged`](../xui-core-ui/index.md#api-5f84a95688318291) flag set since the last validation. This flag does not indicate that this view itself needs re-arranging, but rather that some descendant may need to be re-arranged with its existing rectangle (e.g., a visual state change that affects only internal layout).

<a id="api-334215589ced74ce"></a>

### [`ViewFlags.DescendantHitTestChanged`](#api-334215589ced74ce)


```csharp
DescendantHitTestChanged = 1 << 8
```

One or more descendants of this [`Xui.Core.UI.View`](../xui-core-ui/index.md#api-0389f82d4babca03) have their hit testing changed. They will probably return a new result for the same [`Xui.Core.Math2D.Point`](../xui-core-math2d/index.md#api-7dfbe8f77fb7adae).

<a id="api-c06c47e3e3bc8e96"></a>

### [`ViewFlags.DescendantRenderChanged`](#api-c06c47e3e3bc8e96)


```csharp
DescendantRenderChanged = 1 << 6
```

One or more descendants of this [`Xui.Core.UI.View`](../xui-core-ui/index.md#api-0389f82d4babca03) have had their [`Xui.Core.UI.View.ViewFlags.RenderChanged`](../xui-core-ui/index.md#api-f563279cb5f5c4f3) flag set since the last validation. This is a hint that rendering work exists below, even if this view itself does not need re-rendering.

<a id="api-03994e1cc9783583"></a>

### [`ViewFlags.HitTestChanged`](#api-03994e1cc9783583)


```csharp
HitTestChanged = 1 << 7
```

This view&#39;s [`Xui.Core.UI.View.HitTest(Xui.Core.Math2D.Point)`](../xui-core-ui/index.md#api-b91d4c95c4df4640) changed. It will probably return a new results for the same [`Xui.Core.Math2D.Point`](../xui-core-math2d/index.md#api-7dfbe8f77fb7adae).

<a id="api-8801ade6468761a5"></a>

### [`ViewFlags.MeasureChanged`](#api-8801ade6468761a5)


```csharp
MeasureChanged = 1 << 2
```

The [`Xui.Core.UI.View`](../xui-core-ui/index.md#api-0389f82d4babca03) has changed since its last measure. It will likely return a different desired size if measured again with the same constraints.

<a id="api-f563279cb5f5c4f3"></a>

### [`ViewFlags.RenderChanged`](#api-f563279cb5f5c4f3)


```csharp
RenderChanged = 1 << 5
```

The [`Xui.Core.UI.View`](../xui-core-ui/index.md#api-0389f82d4babca03) has changed visually since its last render pass, and [`Xui.Core.UI.View.RenderCore(Xui.Core.Canvas.IContext)`](../xui-core-ui/index.md#api-8b78f8e9e0f73a3a) produce different output even if rendered within the same frame and context.


<a id="api-1979bdac6ae93688"></a>

## `class ViewCollection`

A base class for container views that hold and manage a list of child views. Provides methods for adding, removing, rendering, and hit testing children.

```csharp
public class ViewCollection : View
{
    protected readonly List<View> children;
    public override int Count { get; }

    public override View this[int index] { get; }

    public ReadOnlySpan<View> Content { init; }

    public virtual void Add(View child);
    public virtual void Remove(View child);
    public virtual void Clear();
}
```

<a id="api-82304a8062a1d352"></a>

### [`void ViewCollection.Add(View child)`](#api-82304a8062a1d352)


```csharp
public virtual void Add(View child);
```

Adds a view to this container.

**Throws** `Thrown if the view already has a parent.`: Thrown if the view already has a parent.

<a id="api-aef7271822ab9824"></a>

### [`void ViewCollection.Clear()`](#api-aef7271822ab9824)


```csharp
public virtual void Clear();
```

Removes all child views from this container.

<a id="api-35542fa413384e29"></a>

### [`ReadOnlySpan<View> ViewCollection.Content`](#api-35542fa413384e29)


```csharp
public ReadOnlySpan<View> Content { init; }
```

Adds the provided views to this container during object initialization. This property is intended for use with C# object initializers and will not clear existing children.

<a id="api-fe7f9645a86c8591"></a>

### [`int ViewCollection.Count`](#api-fe7f9645a86c8591)


```csharp
public override int Count { get; }
```

Gets the number of child views in this collection.

<a id="api-34f5d0e2ec6f685c"></a>

### [`View ViewCollection.this[int index]`](#api-34f5d0e2ec6f685c)


```csharp
public override View this[int index] { get; }
```

Gets the child view at the specified index.

<a id="api-5a194ce1181f7d20"></a>

### [`void ViewCollection.Remove(View child)`](#api-5a194ce1181f7d20)


```csharp
public virtual void Remove(View child);
```

Removes a view from this container.

<a id="api-dc4d58c7f66e0738"></a>

### [`List<View> ViewCollection.children`](#api-dc4d58c7f66e0738)


```csharp
protected readonly List<View> children;
```

The internal list of child views contained within this view.


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

## `class ViewExtensions`

Provides extension methods for navigating the Xui view tree.

```csharp
public static class ViewExtensions
{
    public static ParentsEnumerable Parents(this View view);
    public static bool TryFindParent<T>(this View view, [NotNullWhen(true)] out T? result)
        where T : View;
    public static View? FindViewById(this View root, string id);
    public static void FindViewsByClass(this View root, string className, List<View> results);
    public readonly ref struct ParentsEnumerable
    {
        public ParentsEnumerable(View? start);
        public Enumerator GetEnumerator();
        public ref struct Enumerator
        {
            public Enumerator(View? start);
            public View Current { get; }

            public bool MoveNext();
        }
    }
}
```

<a id="api-c02e20b4292c96fe"></a>

### [`View? ViewExtensions.FindViewById(View root, string id)`](#api-c02e20b4292c96fe)


```csharp
public static View? FindViewById(this View root, string id);
```

Performs a depth-first search of the view subtree (including `root` itself) and returns the first view whose [`Xui.Core.UI.View.Id`](../xui-core-ui/index.md#api-d2331247a4581d73) matches `id`.

**Returns:** The matching view, or `null` if not found.

<a id="api-52c4a0ceb427bc3a"></a>

### [`void ViewExtensions.FindViewsByClass(View root, string className, List<View> results)`](#api-52c4a0ceb427bc3a)


```csharp
public static void FindViewsByClass(this View root, string className, List<View> results);
```

Performs a depth-first search of the view subtree (including `root` itself) and collects all views whose [`Xui.Core.UI.View.ClassName`](../xui-core-ui/index.md#api-8648505ad7dce669) contains `className`.

<a id="api-66eb1ce1175575ae"></a>

### [`ParentsEnumerable ViewExtensions.Parents(View view)`](#api-66eb1ce1175575ae)


```csharp
public static ParentsEnumerable Parents(this View view);
```

Returns an allocation-free enumerable that walks up the parent chain of a view.

- **`view`** — The view whose parent chain should be traversed.

**Returns:** An enumerable of the view&#39;s parents, from immediate to root.

<a id="api-e300f30a42eae153"></a>

### [`bool ViewExtensions.TryFindParent<T>(View view, out T? result)`](#api-e300f30a42eae153)


```csharp
public static bool TryFindParent<T>(this View view, [NotNullWhen(true)] out T? result)
    where T : View;
```

Attempts to find the first parent of a specific type in the view tree. Zero allocations. Returns true if a matching parent was found.

- **`T`** — The type of view to search for.

- **`view`** — The view whose parent chain will be searched.

- **`result`** — The found parent of type `T`, or null if not found.

**Returns:** True if a matching parent was found; otherwise, false.


<a id="api-94b5fcb77b2b33a2"></a>

## `readonly ref struct ViewExtensions.ParentsEnumerable`

Allocation-free enumerable for walking up the parent chain of a view.

```csharp
public readonly ref struct ParentsEnumerable
{
    public ParentsEnumerable(View? start);
    public Enumerator GetEnumerator();
    public ref struct Enumerator
    {
        public Enumerator(View? start);
        public View Current { get; }

        public bool MoveNext();
    }
}
```

<a id="api-65808e37c392cbe6"></a>

### [`ParentsEnumerable.ParentsEnumerable(View? start)`](#api-65808e37c392cbe6)


```csharp
public ParentsEnumerable(View? start);
```

Creates a new [`Xui.Core.UI.ViewExtensions.ParentsEnumerable`](../xui-core-ui/index.md#api-94b5fcb77b2b33a2) starting from the given view.

- **`start`** — The starting view.

<a id="api-a1644f7ee89a0410"></a>

### [`Enumerator ParentsEnumerable.GetEnumerator()`](#api-a1644f7ee89a0410)


```csharp
public Enumerator GetEnumerator();
```

Returns an enumerator that iterates over the view&#39;s parents.


<a id="api-32961d9d8988900e"></a>

## `ref struct ViewExtensions.ParentsEnumerable.Enumerator`

Enumerator for [`Xui.Core.UI.ViewExtensions.ParentsEnumerable`](../xui-core-ui/index.md#api-94b5fcb77b2b33a2), walking up the view hierarchy.

```csharp
public ref struct Enumerator
{
    public Enumerator(View? start);
    public View Current { get; }

    public bool MoveNext();
}
```

<a id="api-05f8e2347c266a57"></a>

### [`Enumerator.Enumerator(View? start)`](#api-05f8e2347c266a57)


```csharp
public Enumerator(View? start);
```

Initializes a new instance of the [`Xui.Core.UI.ViewExtensions.ParentsEnumerable.Enumerator`](../xui-core-ui/index.md#api-32961d9d8988900e) struct.

- **`start`** — The starting view for traversal.

<a id="api-4a2f387afa77ca1e"></a>

### [`View Enumerator.Current`](#api-4a2f387afa77ca1e)


```csharp
public View Current { get; }
```

Gets the current parent view in the traversal.

<a id="api-d5fce097b0e66937"></a>

### [`bool Enumerator.MoveNext()`](#api-d5fce097b0e66937)


```csharp
public bool MoveNext();
```

Moves to the next parent view.

**Returns:** True if there is a next parent; otherwise, false.


<a id="api-9b30940072677854"></a>

## `enum WritingMode`

Specifies the orientation and flow direction of text and block layout. Affects which axis is considered &quot;block&quot; and &quot;inline&quot;.

```csharp
public enum WritingMode : byte
{
    Inherit,
    HorizontalTB,
    VerticalRL,
    VerticalLR,
    SidewaysRL,
    SidewaysLR
}
```

<a id="api-8c51f8c986893f2e"></a>

### [`WritingMode.HorizontalTB`](#api-8c51f8c986893f2e)


```csharp
HorizontalTB
```

Horizontal writing mode. Text flows left-to-right, lines stack top-to-bottom.

<a id="api-53cd3bf436f7b766"></a>

### [`WritingMode.Inherit`](#api-53cd3bf436f7b766)


```csharp
Inherit
```

Inherit direction from the parent view.

<a id="api-ed8225beab8f4aec"></a>

### [`WritingMode.SidewaysLR`](#api-ed8225beab8f4aec)


```csharp
SidewaysLR
```

Sideways vertical mode. Lines stack left-to-right, with horizontal glyph orientation.

<a id="api-c71d3ec21108de73"></a>

### [`WritingMode.SidewaysRL`](#api-c71d3ec21108de73)


```csharp
SidewaysRL
```

Sideways vertical mode. Lines stack right-to-left, but glyphs are rotated to remain horizontal.

<a id="api-68fdf7f384f49aff"></a>

### [`WritingMode.VerticalLR`](#api-68fdf7f384f49aff)


```csharp
VerticalLR
```

Vertical writing mode. Lines stack left-to-right, text flows top-to-bottom.

<a id="api-4a10aa6640d72c43"></a>

### [`WritingMode.VerticalRL`](#api-4a10aa6640d72c43)


```csharp
VerticalRL
```

Vertical writing mode. Lines stack right-to-left, text flows top-to-bottom.

