Class LayoutConfig
The flexbox-style configuration of a layout container: its Direction (which sets the main axis), the spacing and alignment of its children, and optional padding. Whether the container scrolls is NOT part of the layout — scrolling is configured at the view-definition level (see IScrollableViewDefinition).
Inherited Members
Namespace: Serenity.Ui.Domain.Entities
Assembly: Serenity.Ui.Domain.dll
Syntax
public class LayoutConfig
Remarks
This is the domain description of a layout. Realizing it onto Unity layout primitives is the job of the infrastructure layer; the domain stays free of engine-specific layout details.
Constructors
LayoutConfig()
Creates a layout config with default values (a stretched column).
Declaration
public LayoutConfig()
LayoutConfig(LayoutDirection, float)
Convenience constructor for the common direction + gap case.
Declaration
public LayoutConfig(LayoutDirection direction, float gap = 0)
Parameters
| Type | Name | Description |
|---|---|---|
| LayoutDirection | direction | |
| float | gap |
Fields
Align
Positioning of children along the cross axis (CSS align-items).
Declaration
public LayoutAlignment Align
Field Value
| Type | Description |
|---|---|
| LayoutAlignment |
Direction
The axis along which children are arranged (CSS flex-direction).
Declaration
public LayoutDirection Direction
Field Value
| Type | Description |
|---|---|
| LayoutDirection |
Gap
Gap between adjacent children, in pixels (CSS gap).
Declaration
public float Gap
Field Value
| Type | Description |
|---|---|
| float |
Justify
Distribution of children along the main axis (CSS justify-content).
Declaration
public LayoutAlignment Justify
Field Value
| Type | Description |
|---|---|
| LayoutAlignment |
Padding
Inner spacing between the container edges and its children (CSS padding).
Declaration
public LayoutPadding Padding
Field Value
| Type | Description |
|---|---|
| LayoutPadding |
Properties
IsHorizontal
True when Direction arranges children horizontally (its main axis is X). In this project's convention a COLUMN lays children out as side-by-side columns (horizontal main axis), while a ROW stacks them as rows down the screen (vertical main axis) — i.e. "set ROW, see N rows".
Declaration
public bool IsHorizontal { get; }
Property Value
| Type | Description |
|---|---|
| bool |
IsReversed
True when Direction places children in reverse order.
Declaration
public bool IsReversed { get; }
Property Value
| Type | Description |
|---|---|
| bool |