lepoco / lepoco/wpfui

UI Freezes (takes long to load) with sufficiently large list of items in a combo box. Introduced in PR #1645

Open
#1,704 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
C#
Stars
9.6k
Forks
1k
PR merge metrics
No merged PRs in 30d

Description

Describe the bug

UI Freezes (takes long to load) with sufficiently large list of items in a combo box. Introduced in PR #1645

Image

If I remove the wpf style from the combo box and set the ItemTemplate to VirtualizingStackPanel it loads almost instantly.

This is also a memory issue, as if I have a list of 20k strings I am throwing in this ComboBox it creates 20k items in the visual tree.

The red arrow below is before I click the ComboBox:

Image

The app runs at 300 mb -> I click and it balloons to 1.4 gb.

To Reproduce

Create a list of strings that is sufficient in size, bind it to the ItemsSource and then run, expand the UI and you will see everything I described.

Expected behavior

Run the same code in PR #1703 (changed StackPanel in the ItemTemplate to VirtualizingStackPanel) and you will see the issue is resolved.

Screenshots
Image
OS version

Windows 11

.NET version

10

WPF-UI NuGet version

4.2.0

Additional context

Fixed in #1703

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the combo box changes in PR #1645 and the reported fix in #1703. Reproduce the issue with a large string list on Windows 11 and .NET 10, then verify that expanding the combo box avoids creating all 20k visual elements and no longer causes the reported loading delay or memory spike.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
desktop
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.