Skip to content

Commit c6cfcba

Browse files
authored
Prevented setting 0 to ColumnSpan or RowSpan. (#18516)
This prevents exception that is thrown in Layoutable.MeasureCore if 0 is set to ColumnSpan (for example by calling Grid.SetColumnSpan). In WPF, the ColumnSpan property immediatelly throws ArgumentOfOutRange exception when 0 is set to ColumSpan.
1 parent 1102444 commit c6cfcba

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Avalonia.Controls/Grid.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2780,7 +2780,7 @@ private enum Flags
27802780
AvaloniaProperty.RegisterAttached<Grid, Control, int>(
27812781
"ColumnSpan",
27822782
defaultValue: 1,
2783-
validate: v => v >= 0);
2783+
validate: v => v > 0);
27842784

27852785
/// <summary>
27862786
/// RowSpan property. This is an attached property.
@@ -2796,7 +2796,7 @@ private enum Flags
27962796
AvaloniaProperty.RegisterAttached<Grid, Control, int>(
27972797
"RowSpan",
27982798
defaultValue: 1,
2799-
validate: v => v >= 0);
2799+
validate: v => v > 0);
28002800

28012801
/// <summary>
28022802
/// IsSharedSizeScope property marks scoping element for shared size.

0 commit comments

Comments
 (0)