[Solved] What is the used for in Xamarin Forms and can it be replaced with a value setting?


Using the new syntax, that would translate to:

<Grid ColumnDefinitions="*, 50">

For the complete specs on the new syntax, you can read this: https://github.com/microsoft/microsoft-ui-xaml/issues/673

Basically, <ColumnDefinition /> is the equivalent of <ColumnDefinition Width="*" /> (* is the default value for the Width property).

The width of a column can be expressed in 3 ways:

  • Auto means that the column will automatically size itself based on content, within the available space
  • absolute values like 50, in that case the column will be 50 density-independent pixels wide
  • or * which is actually the equivalent of 1*. * allows you to split the available space proportionally. For example, if you have column A with 1* and column B with 3*, column A will occupy 25% (1 of 4) and column B will occupy 75% (3 of 4).

In your particular case, the second column has a fixed value of 50, so your first column with * width will take up 100% of the remaining width after the 50 is subtracted.

You can check out different examples here:

solved What is the used for in Xamarin Forms and can it be replaced with a value setting?