Browse Source
Merge pull request #12174 from Gundz/12106
Fixed issue where RowDetailsTemplate was getting the wrong DataContext
pull/12364/head
Max Katz
3 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with
1 additions and
4 deletions
-
src/Avalonia.Controls.DataGrid/DataGridRows.cs
|
|
@ -2969,11 +2969,8 @@ namespace Avalonia.Controls |
|
|
var detailsContent = RowDetailsTemplate.Build(dataItem); |
|
|
var detailsContent = RowDetailsTemplate.Build(dataItem); |
|
|
if (detailsContent != null) |
|
|
if (detailsContent != null) |
|
|
{ |
|
|
{ |
|
|
|
|
|
detailsContent.DataContext = dataItem; |
|
|
_rowsPresenter.Children.Add(detailsContent); |
|
|
_rowsPresenter.Children.Add(detailsContent); |
|
|
if (dataItem != null) |
|
|
|
|
|
{ |
|
|
|
|
|
detailsContent.DataContext = dataItem; |
|
|
|
|
|
} |
|
|
|
|
|
detailsContent.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); |
|
|
detailsContent.Measure(new Size(double.PositiveInfinity, double.PositiveInfinity)); |
|
|
RowDetailsHeightEstimate = detailsContent.DesiredSize.Height; |
|
|
RowDetailsHeightEstimate = detailsContent.DesiredSize.Height; |
|
|
_rowsPresenter.Children.Remove(detailsContent); |
|
|
_rowsPresenter.Children.Remove(detailsContent); |
|
|
|