Browse Source

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.
pull/18523/head
Andrej Benedik 11 months ago
committed by GitHub
parent
commit
c6cfcbacba
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      src/Avalonia.Controls/Grid.cs

4
src/Avalonia.Controls/Grid.cs

@ -2780,7 +2780,7 @@ namespace Avalonia.Controls
AvaloniaProperty.RegisterAttached<Grid, Control, int>(
"ColumnSpan",
defaultValue: 1,
validate: v => v >= 0);
validate: v => v > 0);
/// <summary>
/// RowSpan property. This is an attached property.
@ -2796,7 +2796,7 @@ namespace Avalonia.Controls
AvaloniaProperty.RegisterAttached<Grid, Control, int>(
"RowSpan",
defaultValue: 1,
validate: v => v >= 0);
validate: v => v > 0);
/// <summary>
/// IsSharedSizeScope property marks scoping element for shared size.

Loading…
Cancel
Save