Browse Source

Temporarily hook row and col def change to ExtData.

pull/2563/head
Jumar Macato 7 years ago
parent
commit
9dc40dc99b
No known key found for this signature in database GPG Key ID: B19884DAC3A5BF3F
  1. 15
      src/Avalonia.Controls/GridWPF.cs

15
src/Avalonia.Controls/GridWPF.cs

@ -207,7 +207,12 @@ namespace Avalonia.Controls
_columnDefinitions = value;
_columnDefinitions.TrackItemPropertyChanged(_ => InvalidateMeasure());
_columnDefinitions.CollectionChanged += (_, __) => InvalidateMeasure();
_columnDefinitions.CollectionChanged += (_, __) =>
{
_data.DefinitionsU = _columnDefinitions.Select(p => (DefinitionBase)p).ToArray();
InvalidateMeasure();
};
}
}
@ -237,11 +242,15 @@ namespace Avalonia.Controls
_rowDefinitions = value;
_rowDefinitions.TrackItemPropertyChanged(_ => InvalidateMeasure());
_rowDefinitions.CollectionChanged += (_, __) => InvalidateMeasure();
_rowDefinitions.CollectionChanged += (_, __) =>
{
_data.DefinitionsV = _rowDefinitions.Select(p => (DefinitionBase)p).ToArray();
InvalidateMeasure();
};
}
}
private bool rowColDefsEmpty => (RowDefinitions == null || RowDefinitions?.Count == 0 ) &&
private bool rowColDefsEmpty => (RowDefinitions == null || RowDefinitions?.Count == 0) &&
(ColumnDefinitions == null || ColumnDefinitions?.Count == 0);
/// <summary>

Loading…
Cancel
Save