Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

File Download (not async) and Progress Indicator

$
0
0

I have a ViewController with a Refresh button that, when clicked, uses WebClient() to download (non-async) a new/replacement text file (which is the datasource of the TableView) and refreshes the TableView in focus. That all works fine.

The issue is when I'm trying to use a progress indicator such as BTProgressHUD. As you've probably guessed, it doesn't show until the end of the file download and TableView refresh and then you just see a quick appearance of it right before the .Dismiss/Hide method is invoked.

The WebClient() file download and the TableView refresh both occur in the Refresh() event of the Refresh button which is also where I've currently added the progress indicator.

I have looked at information regarding creating separate tasks/threads since doing a non-async download (like I'm doing) is blocking the main/current thread but I think I need the non-async download because I want the user to stay put and wait for the new file and the TableView refresh.

Wondering if anyone has ideas for adding a progress indicator in this scenario or perhaps there are other/better ways to go about the file download in conjunction with this?

Thanks for any feedback. Doug


Viewing all articles
Browse latest Browse all 204402

Trending Articles