Closed observer1 closed 1 year ago
I'm not sure that this is 100% correct solution but If in ListViewRender replace lines [286-290]
foreach (var item in TemplatedItemsView.TemplatedItems) { items.Add(item); } _listview.ItemsSource = items;
with line
_listview.ItemsSource = TemplatedItemsView.TemplatedItems;
it will start working blazingly fast. This is is only for ungrouped data.
I have attached working solution with modified ListViewRendere
TestList.zip
In original sample, the problem is with unhooking events (UnhookAndClear() method is called 20000 times for each of item). In UWP we don't have such issue : UnhookAndClear() method has not been called at all.
Taking into consideration the remaining lifetime of Xamarin.Forms, the platform this is about, the age of this issue and the traction this issue has seen I think it's unlikely that this will get fixed. If it is something that you still would like to have, please consider opening a PR. Thanks!
Description
Listview on WPF takes a lot to clear thounsands of items
Steps to Reproduce
Expected Behavior
The listview should clear instantly
Actual Behavior
The listview takes a lot of time to clear
Basic Information
Screenshots
Reproduction Link
Test - Copy.zip