Align
ConsoleMonster.Layout
Places a content at its measured size inside a larger region: left, centre or right, and top, middle or bottom. Horizontally aligned content claims the full offered width so it can be centred or pushed right; vertical alignment applies when the parent gives the content more rows than it measured (a fixed height or a fill share). Children that already measure to the full width, such as progress bars, are unaffected horizontally.
Inheritance
- object
- Align
Usage
Explore 15 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 7
- Extension method Align.Content
- Extension method Align.Horizontal
- Extension method Align.Vertical
- Method AlignFluent.Content
- Method AlignFluent.Horizontal
- Method AlignFluent.Vertical
- Method Ui.Align
Accepted by parameters 8
- Extension method Align.Content
- Extension method Align.Horizontal
- Extension method Align.Vertical
- Method AlignFluent.Content
- Method AlignFluent.Horizontal
- Method AlignFluent.Vertical
- Method ContentBuilder.Align
- Method ContentBuilder.Align
Constructors
public Align(IWidget? content = null, HorizontalAlignment horizontal = Center, VerticalAlignment vertical = Top) #Creates an alignment wrapper.
Parameters
- content ConsoleMonster.Layout.IWidget? = null
- The content.
- horizontal ConsoleMonster.Layout.HorizontalAlignment = Center
- Horizontal placement (default centre).
- vertical ConsoleMonster.Layout.VerticalAlignment = Top
- Vertical placement (default top).
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.
Inherited Methods
Properties
Extension Methods
public static Align Content(Align align, IWidget content) #Configures this container's content before session ownership.
Parameters
- align ConsoleMonster.Layout.Align
- The instance.
- content ConsoleMonster.Layout.IWidget
- The widget or nested content builder.
public static Align Content(Align align, Action<ContentBuilder> content) #Configures this container's content before session ownership.
Parameters
- align ConsoleMonster.Layout.Align
- The instance.
- content System.Action<ConsoleMonster.Layout.ContentBuilder>
- The widget or nested content builder.
public static Align Horizontal(Align align, HorizontalAlignment value) #Sets Align.Horizontal: Horizontal placement.
Parameters
- align ConsoleMonster.Layout.Align
- The instance.
- value ConsoleMonster.Layout.HorizontalAlignment
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Align { Horizontal = value }; Ui.Align().Horizontal(value);public static Align Vertical(Align align, VerticalAlignment value) #Sets Align.Vertical: Vertical placement.
Parameters
- align ConsoleMonster.Layout.Align
- The instance.
- value ConsoleMonster.Layout.VerticalAlignment
- The value.
Examples
// C# initializer or property // C# fluent
new global::ConsoleMonster.Layout.Align { Vertical = value }; Ui.Align().Vertical(value);