浏览代码

Add column support for grid layout.

walterlv 7 年之前
父节点
当前提交
c32c619322
共有 1 个文件被更改,包括 6 次插入0 次删除
  1. 6 0
      src/Avalonia.Controls/Utils/GridLayout.cs

+ 6 - 0
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);