Skip to main content

Flex Class

Definition​

Assembly:Avalonia.Controls
Package:Avalonia
Source:Flex.cs

Provides attached properties for controlling the layout behavior of child elements within a Avalonia.Controls.FlexPanel.

public class Flex

Inheritance: object -> Flex

Methods​

NameDescription
GetAlignSelfGets the cross-axis alignment override for a child item in a Avalonia.Controls.FlexPanel
GetBasisGets the initial size along the main-axis of an item in a Avalonia.Controls.FlexPanel, before free space is distributed according to the flex factors.
GetGrowGets the factor by which an item can grow along the main-axis, relative to other items in a Avalonia.Controls.FlexPanel.
GetOrderRetrieves the order in which a child item appears within the Avalonia.Controls.FlexPanel.
GetShrinkGets the factor by which an item can shrink along the main-axis, relative to other items in a Avalonia.Controls.FlexPanel.
SetAlignSelfNo summary available.
SetBasisSets the initial size along the main-axis of an item in a Avalonia.Controls.FlexPanel, before free space is distributed according to the flex factors.
SetGrowSets the factor by which an item can grow along the main-axis, relative to other items in a Avalonia.Controls.FlexPanel.
SetOrderSets the order in which a child item appears within the Avalonia.Controls.FlexPanel.
SetShrinkSets the factor by which an item can shrink along the main-axis, relative to other items in a Avalonia.Controls.FlexPanel.

GetAlignSelf Method​

Gets the cross-axis alignment override for a child item in a Avalonia.Controls.FlexPanel

public Nullable<Avalonia.Controls.FlexAlignItems> GetAlignSelf(Avalonia.Layout.Layoutable layoutable)

Parameters​

layoutable Avalonia.Layout.Layoutable

Returns​

Nullable<Avalonia.Controls.FlexAlignItems>

Remarks​

This property is used to override the Avalonia.Controls.FlexPanel.AlignItems property for a specific child. When omitted, Avalonia.Controls.FlexPanel.AlignItems in not overridden. Equivalent to CSS align-self property.

GetBasis Method​

Gets the initial size along the main-axis of an item in a Avalonia.Controls.FlexPanel, before free space is distributed according to the flex factors.

public Avalonia.Controls.FlexBasis GetBasis(Avalonia.Layout.Layoutable layoutable)

Parameters​

layoutable Avalonia.Layout.Layoutable

Returns​

Avalonia.Controls.FlexBasis

Remarks​

Either automatic size, a fixed length, or a percentage of the container's size. When omitted, it is set to Avalonia.Controls.FlexBasis.Auto. Equivalent to CSS flex-basis property.

GetGrow Method​

Gets the factor by which an item can grow along the main-axis, relative to other items in a Avalonia.Controls.FlexPanel.

public double GetGrow(Avalonia.Layout.Layoutable layoutable)

Parameters​

layoutable Avalonia.Layout.Layoutable

Returns​

double

Remarks​

When omitted, it is set to 0. Equivalent to CSS flex-grow property.

GetOrder Method​

Retrieves the order in which a child item appears within the Avalonia.Controls.FlexPanel.

public int GetOrder(Avalonia.Layout.Layoutable layoutable)

Parameters​

layoutable Avalonia.Layout.Layoutable

Returns​

int

Remarks​

A lower order value means the item will be positioned earlier within the container. Items with the same order value are laid out in their source document order. When omitted, it is set to 0. Equivalent to CSS order property.

GetShrink Method​

Gets the factor by which an item can shrink along the main-axis, relative to other items in a Avalonia.Controls.FlexPanel.

public double GetShrink(Avalonia.Layout.Layoutable layoutable)

Parameters​

layoutable Avalonia.Layout.Layoutable

Returns​

double

Remarks​

When omitted, it is set to 1. Equivalent to CSS flex-shrink property.

SetAlignSelf Method​

public void SetAlignSelf(Avalonia.Layout.Layoutable layoutable, Nullable<Avalonia.Controls.FlexAlignItems> value)

Parameters​

layoutable Avalonia.Layout.Layoutable

value Nullable<Avalonia.Controls.FlexAlignItems>

SetBasis Method​

Sets the initial size along the main-axis of an item in a Avalonia.Controls.FlexPanel, before free space is distributed according to the flex factors.

public void SetBasis(Avalonia.Layout.Layoutable layoutable, Avalonia.Controls.FlexBasis value)

Parameters​

layoutable Avalonia.Layout.Layoutable

value Avalonia.Controls.FlexBasis

Remarks​

Either automatic size, a fixed length, or a percentage of the container's size. When omitted, it is set to Avalonia.Controls.FlexBasis.Auto. Equivalent to CSS flex-basis property.

SetGrow Method​

Sets the factor by which an item can grow along the main-axis, relative to other items in a Avalonia.Controls.FlexPanel.

public void SetGrow(Avalonia.Layout.Layoutable layoutable, double value)

Parameters​

layoutable Avalonia.Layout.Layoutable

value double

Remarks​

When omitted, it is set to 0. Equivalent to CSS flex-grow property.

SetOrder Method​

Sets the order in which a child item appears within the Avalonia.Controls.FlexPanel.

public void SetOrder(Avalonia.Layout.Layoutable layoutable, int value)

Parameters​

layoutable Avalonia.Layout.Layoutable

value int

Remarks​

A lower order value means the item will be positioned earlier within the container. Items with the same order value are laid out in their source document order. When omitted, it is set to 0. Equivalent to CSS order property.

SetShrink Method​

Sets the factor by which an item can shrink along the main-axis, relative to other items in a Avalonia.Controls.FlexPanel.

public void SetShrink(Avalonia.Layout.Layoutable layoutable, double value)

Parameters​

layoutable Avalonia.Layout.Layoutable

value double

Remarks​

When omitted, it is set to 1. Equivalent to CSS flex-shrink property.

Fields​

NameDescription
AlignSelfPropertyDefines an attached property to control the cross-axis alignment of a specific child in a flex layout.
BasisPropertyDefines an attached property to control the initial main-axis size of a specific child in a flex layout.
GrowPropertyDefines an attached property to control the factor by which a specific child can grow along the main-axis in a flex layout.
OrderPropertyDefines an attached property to control the order of a specific child in a flex layout.
ShrinkPropertyDefines an attached property to control the factor by which a specific child can shrink along the main-axis in a flex layout.

AlignSelfProperty Field​

Defines an attached property to control the cross-axis alignment of a specific child in a flex layout.

public Avalonia.AttachedProperty<Nullable<Avalonia.Controls.FlexAlignItems>> AlignSelfProperty

BasisProperty Field​

Defines an attached property to control the initial main-axis size of a specific child in a flex layout.

public Avalonia.AttachedProperty<Avalonia.Controls.FlexBasis> BasisProperty

GrowProperty Field​

Defines an attached property to control the factor by which a specific child can grow along the main-axis in a flex layout.

public Avalonia.AttachedProperty<double> GrowProperty

OrderProperty Field​

Defines an attached property to control the order of a specific child in a flex layout.

public Avalonia.AttachedProperty<int> OrderProperty

ShrinkProperty Field​

Defines an attached property to control the factor by which a specific child can shrink along the main-axis in a flex layout.

public Avalonia.AttachedProperty<double> ShrinkProperty