Browse Source

Ensure VirtualizingStackPanel correct element size estimate and fix #17460 (#17461)

Co-authored-by: Emmanuel Hansen <emmausssss@gmail.com>
pull/17406/head
BobLd 1 year ago
committed by GitHub
parent
commit
06ab70928d
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 4
      src/Avalonia.Controls/VirtualizingStackPanel.cs

4
src/Avalonia.Controls/VirtualizingStackPanel.cs

@ -2,7 +2,6 @@
using System.Collections.Generic;
using System.Collections.Specialized;
using System.Diagnostics;
using System.Drawing;
using System.Linq;
using Avalonia.Controls.Primitives;
using Avalonia.Controls.Utils;
@ -164,6 +163,9 @@ namespace Avalonia.Controls
_realizedElements ??= new();
_measureElements ??= new();
// We need to set the lastEstimatedElementSizeU before calling CalculateDesiredSize()
_ = EstimateElementSizeU();
// We handle horizontal and vertical layouts here so X and Y are abstracted to:
// - Horizontal layouts: U = horizontal, V = vertical
// - Vertical layouts: U = vertical, V = horizontal

Loading…
Cancel
Save