ConsoleForge 0.3.0
Elm-architecture TUI framework for .NET 8
Loading...
Searching...
No Matches
ConsoleForge.Core.ViewDescriptor Struct Reference

Immutable descriptor for a single rendered frame. More...

Static Public Member Functions

static ViewDescriptor From (IWidget root, RenderContext? existingCtx=null, int? width=null, int? height=null, Theme? theme=null, ColorProfile colorProfile=ColorProfile.TrueColor)
 Convenience factory: render an IWidget into a ViewDescriptor at the given terminal dimensions.

Properties

required string Content [get]
 Pre-rendered ANSI string for the full terminal frame.
CursorDescriptor Cursor [get]
 Cursor state for this frame.
IWidgetRootWidget [get]
 The root widget that was rendered.
string? Title [get]
 Optional terminal window title. Null = no change.

Detailed Description

Immutable descriptor for a single rendered frame.

Produced by IModel.View() and diffed by the renderer.

Member Function Documentation

◆ From()

ViewDescriptor ConsoleForge.Core.ViewDescriptor.From ( IWidget root,
RenderContext? existingCtx = null,
int? width = null,
int? height = null,
Theme? theme = null,
ColorProfile colorProfile = ColorProfile::TrueColor )
static

Convenience factory: render an IWidget into a ViewDescriptor at the given terminal dimensions.

Parameters
rootRoot widget to render.
existingCtxOptional persistent RenderContext for double-buffered diff rendering. If provided, RenderContext.Reset is called to reuse it for this frame. If null, a fresh context is created (stateless, full redraw).
widthTerminal width. Defaults to Console.WindowWidth.
heightTerminal height. Defaults to Console.WindowHeight.
themeTheme. Defaults to Theme.Default.
colorProfileColor profile for ANSI output.

Property Documentation

◆ RootWidget

IWidget? ConsoleForge.Core.ViewDescriptor.RootWidget
get

The root widget that was rendered.

Used by the framework for focus traversal via FocusManager.


The documentation for this struct was generated from the following file:
  • src/ConsoleForge/Core/ViewDescriptor.cs