Forum Xamarin Xamarin.Forms

ProgressBar bogs down SQLite search

BrianConradBrianConrad USMember ✭✭✭

In my app I have an app the imports data from the user's SQLite database. Originally when testing with 300 rows in the database the import went fairly fast just a few seconds and the ProgressBar accurately zipped across the top. Now it seems that the progress bar is dragging things down ridiculously. If I don't use the ProgressBar even with a database of over 2500 items it takes only a few seconds. Seems the await is the problem but if I leave that out the progress bar displays only halfway through when the import is finished at close to the same amount of time as without the ProgressBar.

The loop is simple: get data->bump progress repeat

I have searched for any similar situations mentioned and do wonder if the ProgessBar should be on another thread? I haven't found any examples of this (though it's sometimes hard to get the magic search words). Seems on every screen refresh the ProgressBar should update wherever to the current item number imported even if the last refresh was at 100 fewer items. That should keep it up to date and not bog down the import. It's probably doing this when the await is left out.

Anyone solve this problem or is it just the way the control is going to work? Or maybe the best solution is to leave out the await which gives the user a sense that something is happening anyway.


Sign In or Register to comment.