From c32c6193221ac8a233363c6e94a45b928ec20f46 Mon Sep 17 00:00:00 2001 From: walterlv Date: Sat, 28 Apr 2018 21:48:12 +0800 Subject: [PATCH] Add column support for grid layout. --- src/Avalonia.Controls/Utils/GridLayout.cs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/Avalonia.Controls/Utils/GridLayout.cs b/src/Avalonia.Controls/Utils/GridLayout.cs index 2497a5f46c..439b6830b9 100644 --- a/src/Avalonia.Controls/Utils/GridLayout.cs +++ b/src/Avalonia.Controls/Utils/GridLayout.cs @@ -117,6 +117,9 @@ namespace Avalonia.Controls.Utils public static implicit operator LengthDefinitions(RowDefinitions rows) => new LengthDefinitions(rows.Select(x => (LengthDefinition) x)); + + public static implicit operator LengthDefinitions(ColumnDefinitions rows) + => new LengthDefinitions(rows.Select(x => (LengthDefinition)x)); } internal class LengthDefinition @@ -135,6 +138,9 @@ namespace Avalonia.Controls.Utils public static implicit operator LengthDefinition(RowDefinition row) => new LengthDefinition(row.Height, row.MinHeight, row.MaxHeight); + public static implicit operator LengthDefinition(ColumnDefinition row) + => new LengthDefinition(row.Width, row.MinWidth, row.MaxWidth); + public void Update(double pixel) { Length = new GridLength(pixel);