Interface IStackLayoutComponent
The stack layout component organizes its children in a one-dimensional line ("stack"), either horizontally, or vertically. The default is a simple vertical layout (top to bottom).
Inherited Members
Namespace: AGS.API
Assembly: AGS.API.dll
Syntax
[RequiredComponent(typeof(IInObjectTreeComponent), true)]
public interface IStackLayoutComponent : IComponent, IDisposable, INotifyPropertyChanged
Properties
| Improve this Doc View SourceAbsoluteSpacing
Gets or sets the absolute spacing between each item in the layout. This is an extra constant spacing that will be applied on top of the RelativeSpacing. This will either set the X or the Y of the children depending on the Direction of the layout. Set a positive x for left-to-right or negative x for right-to-left. Set a positive y for bottom-to-top or negative y for top-to-bottom.
Declaration
float AbsoluteSpacing { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The spacing. |
CenterLayout
Gets or sets a value indicating whether this IStackLayoutComponent centers layout around StartLocation. The default is false, meaning that StartLocation will be used as the starting point and not as the center.
Declaration
bool CenterLayout { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
Direction
Gets or sets the direction of the layout (horizontal or vertical).
Declaration
LayoutDirection Direction { get; set; }
Property Value
Type | Description |
---|---|
LayoutDirection | The direction. |
EntitiesToIgnore
Gets a list of entitiy IDs to ignore from the layout.
Declaration
IConcurrentHashSet<string> EntitiesToIgnore { get; }
Property Value
Type | Description |
---|---|
IConcurrentHashSet<System.String> | The entities to ignore. |
LayoutAfterCrop
Gets or sets whether the layout should account for any cropping made to the inner children. A use-case for this is when laying out a child which crops its children (i.e "your" grandchildren). A use-case for not enabling this (the default) is when you're laying out children inside a scrollable (and cropping) panel.
Declaration
bool LayoutAfterCrop { get; set; }
Property Value
Type | Description |
---|---|
System.Boolean |
|
OnLayoutChanged
An event which fires whenever the layout changes.
Declaration
IBlockingEvent OnLayoutChanged { get; }
Property Value
Type | Description |
---|---|
IBlockingEvent | The on layout changed event. |
RelativeSpacing
Gets or sets the relative spacing between each item in the layout. This is a factor which will multiply by the size of each item. This will either set the X or the Y of the children depending on the Direction of the layout. Set the X spacing for a width multiplier (1 will assign left-to-right, -1 will assign right-to-left). Set the Y spacing for a height multiplier (1 will assign bottom-to-top, -1 will assign top-to-bottom).
Declaration
float RelativeSpacing { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The relative spacing. |
StartLocation
Gets or sets the start location, which is the first item in the layout will be placed in that location, unless CenterLayout is enabled (in which case it represents the center point of the layout).
Declaration
float StartLocation { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The start location. |
Methods
| Improve this Doc View SourceDryRun()
Performs the calculation of the layout without actually changing anything, and returns the width/height (depending if this is a horizontal/vertical layout) of the potential layout.
Declaration
float DryRun()
Returns
Type | Description |
---|---|
System.Single | The width/height of the potential layout. |
ForceRefreshLayout()
Forces a layout refresh now (blocking), assuming layout was started. This should only be done from the update thread.
Declaration
void ForceRefreshLayout()
StartLayout()
Starts applying the layout to its children (this needs to be called at least once).
Declaration
void StartLayout()
StopLayout()
Stops applying the layout to its children.
Declaration
void StopLayout()