How to speed up ListBox rendering and ListCollectionView filtering?

There is a twofold question here, but I think that these two subjects are intertwined enough to guarantee their inclusion together.

Our application has ListBoxone that is filled with what can be a large number of elements. Each of these elements is displayed with a rather complex element template. This is necessarily quite difficult, and although it could have been slightly reduced, I probably could not take a huge amount. Elements in ListBoxcome from ListCollectionViewwhich is built from ObservableCollection<>objects to display.

We have two problems.

Firstly, when we reconfigure filters for ListCollectionViewand call Refreshon it, a very noticeable lock for several seconds is observed in the user interface, when it breaks down and is recreated, and ListBoxrepopulate. The duration of this lock seems to be related to the number of elements contained in ListBox, and is the longest when the client areaListBoxfull of elements. We are pretty sure that blocking is caused by recreating element templates. I tried to turn on virtualization, but this did not affect the reduction or elimination of the slowdown. I also consider some other optimizations, such as checking our bindings and changing layouts. Is there any method to avoid this particular problem, speed it up, or move it to another thread? (I know that the latter is very unlikely, because the rendering is single-threaded, but maybe there is some workaround ...)

ListCollectionView. , , , . , , Refresh ListCollectionView ? , -, ListCollectionView .

.

+5
3

this SO- datagrid - ...

+2

, . , , . , , , , , ? .

+2

2 , ListBox:

VirtualizingStackPanel ItemsPanel . . , . , CanContentScroll="True" !

. , , . , VirtualizingStackPanel.VirtualizationMode="Recycling"

, , codeproject,

+1

All Articles