按需下载 Prism 模块时显示进度指示器
我有一个使用 Prism 2.2 的 Silverlight 4 应用程序,并且有一些模块,我通过在模块目录中将它们定义为按需加载(通过 xaml 文件),然后使用 ModuleManager 请求下载模块来按需加载一些
模块Prism 中的机制来确定模块下载何时完成并获取下载进度事件?
棱镜 codeplex 网站上有一个线程,但对于进行讨论的人们来说,似乎没有一个建议有效
http://compositewpf.codeplex.com/Thread/View.aspx?ThreadId=47957
谢谢 迈克尔
I have a Silverlight 4 app using Prism 2.2 and I have a few modules that I am loading on demand by defining them as ondemand in the module catalog (via a xaml file) and then using the ModuleManager to request the module be downloaded
Is there a mechanism in Prism to determine when the module download is completed and get to download progress events?
There was a thread on the prism codeplex site but none of the suggestions seemed to pan out for the folks having the discussion
http://compositewpf.codeplex.com/Thread/View.aspx?ThreadId=47957
thanks
Michael
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
事实证明,codeplex 上的棱镜讨论中提供的解决方案非常有效
http ://compositewpf.codeplex.com/Thread/View.aspx?ThreadId=47957
我创建了一个名为 FileDownloaderWithProgress 的自定义 FileDownloader。
我想对 Prism 中的现有客户端进行子类化,但触发 DownloadProgressChanged 事件的 WebClient 是私有的。所以我必须通过实现 IFileDownloader 创建自己的。
在 FileDownloaderWithProgress 类的 DownloadProgressChanged 事件处理程序中,我发布了一个 Prism 事件,其中包含完成百分比和已下载的模块名称。
It turns out that the solution provided in the prism discussion on codeplex worked like a charm
http://compositewpf.codeplex.com/Thread/View.aspx?ThreadId=47957
I created a custom FileDownloader called FileDownloaderWithProgress.
I wanted to subclass the existing one in Prism but the WebClient that fires the DownloadProgressChanged event was private. So I had to create my own by implementing IFileDownloader.
In the DownloadProgressChanged event handler in the FileDownloaderWithProgress class- I publish a Prism event that includes the % complete and the module name that was downloaded.