|
|
|
@ -2172,34 +2172,18 @@ namespace Avalonia.Controls |
|
|
|
protected override void OnDataContextBeginUpdate() |
|
|
|
{ |
|
|
|
base.OnDataContextBeginUpdate(); |
|
|
|
foreach (DataGridRow row in GetAllRows()) |
|
|
|
{ |
|
|
|
foreach (DataGridCell cell in row.Cells) |
|
|
|
{ |
|
|
|
if (cell.Content is StyledElement) |
|
|
|
{ |
|
|
|
DataContextProperty.Notifying?.Invoke((IAvaloniaObject)cell.Content, true); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
NotifyDataContextPropertyForAllRowCells(GetAllRows(), true); |
|
|
|
} |
|
|
|
|
|
|
|
/// <inheritdoc/>
|
|
|
|
protected override void OnDataContextEndUpdate() |
|
|
|
{ |
|
|
|
base.OnDataContextEndUpdate(); |
|
|
|
foreach (DataGridRow row in GetAllRows()) |
|
|
|
{ |
|
|
|
foreach (DataGridCell cell in row.Cells) |
|
|
|
{ |
|
|
|
if (cell.Content is StyledElement) |
|
|
|
{ |
|
|
|
DataContextProperty.Notifying?.Invoke((IAvaloniaObject)cell.Content, false); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
NotifyDataContextPropertyForAllRowCells(GetAllRows(), false); |
|
|
|
} |
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// Raises the BeginningEdit event.
|
|
|
|
/// </summary>
|
|
|
|
@ -3197,6 +3181,20 @@ namespace Avalonia.Controls |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private static void NotifyDataContextPropertyForAllRowCells(IEnumerable<DataGridRow> rowSource, bool arg2) |
|
|
|
{ |
|
|
|
foreach (DataGridRow row in rowSource) |
|
|
|
{ |
|
|
|
foreach (DataGridCell cell in row.Cells) |
|
|
|
{ |
|
|
|
if (cell.Content is StyledElement cellContent) |
|
|
|
{ |
|
|
|
DataContextProperty.Notifying?.Invoke(cellContent, arg2); |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
private void UpdateRowDetailsVisibilityMode(DataGridRowDetailsVisibilityMode newDetailsMode) |
|
|
|
{ |
|
|
|
int itemCount = DataConnection.Count; |
|
|
|
|