Raise the File Downloaded Completed EventÄownloader downloader = (Downloader)sender Check if we have anything attached to the event Private void _mediaDownloader_Completed( object sender, EventArgs e) Public event EventHandler FileDownloadProgressChanged Public event EventHandler FileDownloadCompleted Public event EventHandler DownloadCompleted This downloader class can work in multiple modes, if you are working under a file system, then it will just set the image, video sources directly for you (and won't use the downloader), if you specifiy a ZipFile it will download the zipfile for you (using the downloader (unless working in local mode, where it will use the local path and ignore the zip)), finally if you have multiple files to be downloaded (and don't want to use a zip file (large number of files to be displayed, and you wish to show them whenever they have downloaded, then this will also work for you). I have therefore created a little downloader which can be used for media elements (will not work for xaml, or xml documents), but will work great for images and videos. It is nice to work directly from the file system and skipping out IIS, but you want to develop your applications to use the downloaders from the beginning. One of the issues with the 1.1 Alpha Refresh for Silverlight is that if you attempt to use the downloader object when you are working from the local file system, it will throw up an exception.
0 Comments
Leave a Reply. |