Skip to content
This repository has been archived by the owner on May 1, 2024. It is now read-only.

Commit

Permalink
[C] Invalidate Grid when row/col def is replaced (#13320) fixes #13154
Browse files Browse the repository at this point in the history
We invalidate when the items of the row/col def are modified. With this,
we also invalidate when the full collection is swapped.

- fixes #13154
  • Loading branch information
StephaneDelcroix committed Jan 15, 2021
1 parent de4d0bc commit 51ca97b
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Xamarin.Forms.Core/Grid.cs
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ public partial class Grid : Layout<View>, IGridController, IElementConfiguration
((ColumnDefinitionCollection)oldvalue).ItemSizeChanged -= ((Grid)bindable).OnDefinitionChanged;
if (newvalue != null)
((ColumnDefinitionCollection)newvalue).ItemSizeChanged += ((Grid)bindable).OnDefinitionChanged;
((Grid)bindable).OnDefinitionChanged(bindable, EventArgs.Empty);
}, defaultValueCreator: bindable =>
{
var colDef = new ColumnDefinitionCollection();
Expand All @@ -44,6 +45,7 @@ public partial class Grid : Layout<View>, IGridController, IElementConfiguration
((RowDefinitionCollection)oldvalue).ItemSizeChanged -= ((Grid)bindable).OnDefinitionChanged;
if (newvalue != null)
((RowDefinitionCollection)newvalue).ItemSizeChanged += ((Grid)bindable).OnDefinitionChanged;
((Grid)bindable).OnDefinitionChanged(bindable, EventArgs.Empty);
}, defaultValueCreator: bindable =>
{
var rowDef = new RowDefinitionCollection();
Expand Down

0 comments on commit 51ca97b

Please sign in to comment.