Interface 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 TView provides resources and invalidation callbacks;
the layer carries its own state and logic.
public interface ILayer<in TView> where TView : ILayerHost
Type Parameters
TViewThe host type for this layer. Must implement ILayerHost. Almost always View; use a more derived type only when the layer needs access to host-specific APIs beyond the ILayerHost contract.
Methods
Animate(TView, TimeSpan, TimeSpan)
Advances time-based state (animations, blinking cursors, etc.).
void Animate(TView view, TimeSpan previousTime, TimeSpan currentTime)
Parameters
Arrange(TView, Rect, IMeasureContext)
Finalises position and size within rect.
void Arrange(TView view, Rect rect, IMeasureContext context)
Parameters
viewTViewrectRectcontextIMeasureContext
Measure(TView, Size, IMeasureContext)
Returns the desired border-edge size given the available space.
Size Measure(TView view, Size availableSize, IMeasureContext context)
Parameters
viewTViewavailableSizeSizecontextIMeasureContext
Returns
OnBlur(TView)
Called when the host view loses keyboard focus.
void OnBlur(TView view)
Parameters
viewTView
OnChar(TView, ref KeyEventRef)
Handles a character input event while the host view has focus.
void OnChar(TView view, ref KeyEventRef e)
Parameters
viewTVieweKeyEventRef
OnFocus(TView)
Called when the host view gains keyboard focus.
void OnFocus(TView view)
Parameters
viewTView
OnKeyDown(TView, ref KeyEventRef)
Handles a key-down event while the host view has focus.
void OnKeyDown(TView view, ref KeyEventRef e)
Parameters
viewTVieweKeyEventRef
OnPointerEvent(TView, ref PointerEventRef, EventPhase)
Handles a pointer event in the given dispatch phase.
void OnPointerEvent(TView view, ref PointerEventRef e, EventPhase phase)
Parameters
viewTViewePointerEventRefphaseEventPhase
Render(TView, IContext)
Draws content. Called after Arrange.
void Render(TView view, IContext context)
Parameters
viewTViewcontextIContext
Update(TView, ref LayoutGuide)
Drives one or more layout passes. Mirrors Update(LayoutGuide). The default per-pass methods are preferred for clarity; override this only when a single-DFS LuminarFlow traversal is needed (leaf layers or single-child-stretch containers).
void Update(TView view, ref LayoutGuide guide)
Parameters
viewTViewguideLayoutGuide