Steady
ConsoleMonster.Layout
Keeps the largest size its content has needed, so a live region that loses rows (finished workers, a shorter list) does not shrink and move everything below it. The size is held by this instance: keep the same Steady across frames and replace or update its content. Steady.MinHeight reserves rows before the content needs them, so the layout does not grow either. The size is held for the width it was rendered at: after a resize the region measures from its content again. Call Steady.Reset when the region starts a new, unrelated phase.
Inheritance
- object
- Steady
Usage
Explore 8 API references to this type
This type appears in these public API surfaces even when no hand-authored example is attached directly to the page.
Returned or exposed by 4
- Method LayoutFluent.Content
- Method LayoutFluent.MinHeight
- Extension method Steady.Content
- Extension method Steady.MinHeight
Accepted by parameters 4
- Method LayoutFluent.Content
- Method LayoutFluent.MinHeight
- Extension method Steady.Content
- Extension method Steady.MinHeight
Constructors
public Steady(IWidget? content = null) #Creates a steady region.
Parameters
- content ConsoleMonster.Layout.IWidget? = null
- The content.
Methods
public Size Measure(Constraints constraints, RenderContext context) #Returns the size the widget wants within the constraints.
Parameters
- constraints ConsoleMonster.Layout.Constraints
- The space offered.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public void Render(Region region, RenderContext context) #Renders into a region. The region may be smaller or larger than the measured size.
Parameters
- region ConsoleMonster.Canvas.Region
- The target region.
- context ConsoleMonster.Canvas.RenderContext
- Profile, theme and glyphs.
public void Reset() #Forgets the held size, so the next frame measures from the content again. In a live session, call it where the content is updated (a live event or the frame callback), like other widget changes.
Inherited Methods
Properties
public IWidget Content { get; set; } #The content; replacing it keeps the size held so far.
Extension Methods
public static Steady Content(Steady steady, IWidget content) #Configures this container's content before session ownership.
Parameters
- steady ConsoleMonster.Layout.Steady
- The instance.
- content ConsoleMonster.Layout.IWidget
- The widget or nested content builder.
public static Steady Content(Steady steady, Action<ContentBuilder> content) #Configures this container's content before session ownership.
Parameters
- steady ConsoleMonster.Layout.Steady
- The instance.
- content System.Action<ConsoleMonster.Layout.ContentBuilder>
- The widget or nested content builder.
public static Steady MinHeight(Steady steady, int value) #Sets Steady.MinHeight: Rows reserved from the first frame (default zero).
Parameters
- steady ConsoleMonster.Layout.Steady
- The instance.
- value int
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Steady { MinHeight = value }; steady.MinHeight(value);