I'm making an app for Windows 10 Mobile Enterprise using the UWP frameworks. I have a number of files to save to disk in a loop, and I want to show a popup ProgressBar
that blocks the user while the files are being saved. I want to update the ProgressBar
every loop iteration, and remove it at the end.
I figured I could make a custom ContentDialog
containing a ProgressBar
, and show the ContentDialog
at the start. I'm confused how to do this though, because the ContentDialog
's ShowAsync()
method blocks while dialog is open.
My guess is that I must either do the ShowAsync()
or the file loop in a new thread/task/whatever. Is there a best practices sort of approach for this?
Note - the progress bar cannot, according to the requirements just go inside the current page. It has to be a popup of some sort that blocks the user until it is closed by the code.