Skip to content

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

@steven-norris

Description

@steven-norris

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions