Skip to content

Commit 1b23964

Browse files
fix(combobox): [WASM] Reduce number of items created by ComboBox
Reduce cache size to a more reasonable value, so that dropdown takes less time to open.
1 parent 664aaf6 commit 1b23964

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/Uno.UI/UI/Xaml/Controls/Primitives/CarouselPanel.netstd.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,10 @@ public partial class CarouselPanel : VirtualizingPanel
1212
public CarouselPanel()
1313
{
1414
_layout.Initialize(this);
15+
16+
// Set CacheLength small to somewhat resemble the UWP CarouselPanel. Note that CarouselPanel doesn't expose a configurable
17+
// CacheLength - Uno's CarouselPanel is borrowing the ItemsStackPanel virtualization strategy.
18+
_layout.CacheLength = 0.5;
1519
}
1620

1721
protected override Size MeasureOverride(Size availableSize) => _layout.MeasureOverride(availableSize);

0 commit comments

Comments
 (0)