File tree Expand file tree Collapse file tree 1 file changed +4
-1
lines changed
src/Avalonia.Controls.TreeDataGrid/Models/TreeDataGrid Expand file tree Collapse file tree 1 file changed +4
-1
lines changed Original file line number Diff line number Diff line change @@ -9,6 +9,7 @@ namespace Avalonia.Controls.Models.TreeDataGrid
9
9
/// </summary>
10
10
public class ColumnList < TModel > : NotifyingListBase < IColumn < TModel > > , IColumns
11
11
{
12
+ private bool _initialized ;
12
13
private double _viewportWidth ;
13
14
14
15
public event EventHandler ? LayoutInvalidated ;
@@ -22,6 +23,7 @@ public void AddRange(IEnumerable<IColumn<TModel>> items)
22
23
public Size CellMeasured ( int columnIndex , int rowIndex , Size size )
23
24
{
24
25
var column = ( IUpdateColumnLayout ) this [ columnIndex ] ;
26
+ _initialized = true ;
25
27
return new Size ( column . CellMeasured ( size . Width , rowIndex ) , size . Height ) ;
26
28
}
27
29
@@ -103,7 +105,8 @@ public void ViewportChanged(Rect viewport)
103
105
if ( _viewportWidth != viewport . Width )
104
106
{
105
107
_viewportWidth = viewport . Width ;
106
- UpdateColumnSizes ( ) ;
108
+ if ( _initialized )
109
+ UpdateColumnSizes ( ) ;
107
110
}
108
111
}
109
112
You can’t perform that action at this time.
0 commit comments