Understanding the new background downloader. A few things seem "obvious" here... and some things not-so-much:
Nice sample app: http://msdn.microsoft.com/en-us/library/windows/apps/xaml/JJ152726(v=win.10).aspx
Downloads should probably be handled centrally, not by individual pages.
A page will have to be able to ask to start a download
A page will have to be able to show the feedback for a download.
Lets think about the UI forΒ a minute. There is going to have to be a way to do various things with these downloads, so...
It should be part of the file listing that we already have (currently, it includes the filename, version, date).
Add a progress bar. The progress bar is not there if the file isn't downloaded. Tapping will start the download.
The progress bar is a marching ant until the first data gets downloaded. This is how something can be marked as "queued".
If the file is completely downloaded and ready to open, then the progress bar is green. Tapping that tile will open the file.
If the file is in progress, the progress bar is red, and marching towards the end, reflecting how much has been downloaded.
So, for this to work, we need a central management object that coordinates all downloads
A method that can be used to start a download
A method that returns a VM that is the progress bar to show the user, and it is controlled by the thing itself.
We will have to make sure that when the view is disconnected, this thing properly goes away!
Upon app start up it will reconnect with all downloads.
It will await on all of them to finish.
It will update progress bars of anyone who cares
It will mark downloaded (??) and remove from the download queue anything done.