按需下载 Prism 模块时显示进度指示器

发布于 2024-09-17 19:25:11 字数 405 浏览 1 评论 0原文

我有一个使用 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

面犯桃花 2024-09-24 19:25:11

事实证明,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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文