UI Thread slow response due to the populating of 50k records file in ViewModel.Source observable collection #4688
Labels
bug
The issue relates to the wizard not working or a problem with the generated code.
Needs: Triage 🔍
Describe the bug
Dear Friends,
first of I would like to appreciate your framework. It is really amazing tool and realy enjoy it. However I'm facing some wierd spec. effect.
I has generated project for DataGrid population with 50 k records from csv file. all works good untill I starting populating ViewModel.Source property this is realy hanging main UI thread. I did moved as much as possible code to the async style but the best i get is slow response UI. Here is how moved my code to the async:
`
public async Task<IEnumerable> ProcessCSVData(string csvFilePath, CSVDataService service)
{
`
What's intersting is that 50k records gets populated in my List for couple of ms, but once I starting use add thouse to the datagrid observable source property
Source.Add(item);
the things are getting really bad.I do understand that the root cause are tons of CollectionUpdate events so I tried to cheat and re-populate Source after I get all data red in my collection as follow:
Source = new ObservableCollection<ADUserObject>(userObjects);
but once i applied this Observable collection stops receiving any events so it end's up empty no matter what you do. I may guess here that the problem is that by the time when I re-initialize Observable collection property it get's hard coded by the comipler in *.g.cs files so it broke some logic somwehre...
I'm really not claim that this is a bug, but If could help me to improve my logick and get main UI thread responsive while it populates 50k lines in Source prop I would be very apprecaite you.
Best regards,
Maks.
To Reproduce
Additional context
No response
Applies to the following platforms:
About your setup
The text was updated successfully, but these errors were encountered: