Googling this issue, I came across "Application.DoEvents()" that supposed solves this but is part of WinForms and is not part of WPF. Is there similar functionality in WPF? In other words, what can I do to avoid getting the “not responding” behaviour even for long lists?
I'm updating the console part of the GUI every 10.000 files with a ".", which displays the dots for a while but then stops working once the "not responding" hits.
The comparison takes place in the "runDataCollection" event of the background worker:
using(progressWorker =newBackgroundWorker())
{
progressWorker.WorkerReportsProgress=true;
progressWorker.WorkerSupportsCancellation=true;
progressWorker.ProgressChanged+=newProgressChangedEventHandler(updateListBoxProgress);
progressWorker.DoWork+=newDoWorkEventHandler(runDataCollection);
progressWorker.RunWorkerCompleted+=(completeDataCollection);
progressWorker.RunWorkerAsync();
}
privatevoid runDataCollection(object sender,DoWorkEventArgs e){try{foreach(List<String> cdbStoreBlobIds in cdbStoreBlobIdsLists){foreach(String cdbStoreBlobId in cdbStoreBlobIds){if(fileCount++%10000==0){ writeOutput(".",false,false, sender);}for(Int32 i =0; i < xtpNamesList.Count; i++){if(xtpNamesList[i]== cdbStoreBlobId.Split(':')[0]){if(xtpStoreBlobIdsLists[i].Contains(cdbStoreBlobId)){ xtpStoreBlobIdsLists[i].Remove(cdbStoreBlobId);break;}}}}}Cheers,
Simon