Xamarin.Forms Guides | Samples

Xamarin.Forms.ColumnDefinition Class

An IDefinition that defines properties for a column in a Grid.

See Also: ColumnDefinition

Syntax

public sealed class ColumnDefinition : BindableObject, IDefinition

Remarks

XAML for Xamarin.Forms supports the following property for the ColumnDefinition class:

PropertyValue
Width

"*" or "Auto" to indicate the corresponding GridUnitType enumeration values, or a number to indicate an absolute width.

App developers can specify GridUnitType values for the ColumnDefinition.Width property in XAML by nesting ColumnDefinition tags inside tags for the Grid.ColumnDefinitions collection property. The following example demonstrates setting three column widths to each of the three valid GridUnitType values:

XAML Example

<Grid.ColumnDefinitions>
    <ColumnDefinition Width="Auto" />
    <ColumnDefinition Width="*" />
    <ColumnDefinition Width="100" />
</Grid.ColumnDefinitions>

Requirements

Namespace: Xamarin.Forms
Assembly: Xamarin.Forms.Core (in Xamarin.Forms.Core.dll)
Assembly Versions: 1.0.0.0, 1.1.0.0, 1.2.0.0, 1.3.0.0, 1.4.0.0, 1.5.0.0, 2.0.0.0

The members of Xamarin.Forms.ColumnDefinition are listed below.

See Also: BindableObject

Public Constructors

Creates a new ColumnDefinition object with default values.

Public Fields

static readonly
WidthPropertyBindableProperty. Backing store for the ColumnDefinition.Width property.

Public Properties

WidthGridLength. Gets or sets the width of the column.

Public Events

SizeChangedEvent that is raised when the size of the column is changed.