I have a ListView with VirtualMode = true and huge number of items (for now ~800,000).
My goal is to sum a field in all selected items, each time selected items changed.
The problem is that enumerating all selected items takes long time when huge number of items are selected. for example, it takes 1 second for enumerate 800,000 selected items. This means that for each single selection change, the user have to wait 1 whole second before the GUI will be responsive again, and that annoying.
I cannot understand why enumerating selected items so slow, enumerating the same number of items in a simple array takes nothing.
How can i speed up the process of enumerating selected items in ListView ?