Namespace Xui.Core.UI.Layer
Classes
- DockLayer
Container for dock layout types. Usage:
DockLayer.Dock3<View, StepButton, NumberInputLayer, StepButton>
- LayerView<TView, TLayer>
A View that owns a single
TLayerstruct and delegates every layout, rendering, and input override to it, passing itself as the fully-typedTViewhost to every layer method.Because the compiler resolves
TLayerstatically, all delegation is devirtualised and inlined by the JIT — zero overhead compared to writing the overrides by hand.Child views: This class is a leaf by default (Count = 0). Subclasses that host child View instances should override Count and this[int], and manage attachment via SetProtectedChild<T>(ref T?, T?). Use ContentLayer to bridge those views back into the layer tree.
Structs
- BorderLayer<TView, TChild>
A layer that draws a background fill, a border stroke, and optional padding around a child layer. Rendering logic is identical to Border but expressed as a composable struct with no heap allocation.
- ContentLayer
A terminal layer that delegates layout and rendering to a child View, bridging the layer tree back into the standard view hierarchy. Input routing is left to the EventRouter which hit-tests the child view directly, so all input methods here are intentional no-ops.
- DockLayer.Dock2<TView, T1, T2>
Two-slot dock layout.
- DockLayer.Dock3<TView, T1, T2, T3>
Three-slot dock layout. Typical usage: Left button | Stretch content | Right button.
- DockLayer.Dock4<TView, T1, T2, T3, T4>
Four-slot dock layout.
- DockLayer.Docked<T>
Pairs a layer with an Align value.
- FocusBorderLayer<TView, TChild>
A BorderLayer<TChild> variant that switches border color when the host view has keyboard focus. All layout and rendering is delegated to an inner BorderLayer<TChild>; only Render(TView, IContext) swaps the color, and OnFocus(TView) / OnBlur(TView) request a repaint.
- TextInputLayer
A leaf layer that implements single-line text input: typing, selection, caret blinking, password masking, and mouse-driven selection. Carries all text state as struct fields.
The layer stores the arranged Xui.Core.UI.Layer.TextInputLayer.contentRect during Arrange(View, Rect, IMeasureContext) so that Render(View, IContext) and pointer hit-testing both know the exact text area, independent of any border or padding applied by a wrapping layer.
Interfaces
- IButtonAction<THost>
Zero-allocation click handler for ButtonLayer<THost,TAction>. Implement as a private nested struct inside the owning view so Execute(THost) receives the fully-typed host and can call any method on it without closures.
- ILayerHost
The contract a host view must satisfy to be used with ILayer<TView>. Provides the invalidation, focus, pointer-capture, and service-resolution APIs that layers call on their host during layout, rendering, and input handling.
- ILayer<TView>
A composable struct that handles a portion of a view's layout, rendering, and input. Layers are value types composed at compile time — no virtual dispatch, no allocations. The host
TViewprovides resources and invalidation callbacks; the layer carries its own state and logic.
Enums
- DockLayer.Align
How a slot consumes available space.