如何向现有 Silverlight 应用程序添加事件聚合?

发布于 2024-08-19 07:31:00 字数 229 浏览 5 评论 0 原文

我有一个现有的 Silverlight 应用程序,其中 Page.xaml 上有一些按钮,可将用户控件加载到 TransitioningContentControl 内容宿主中。每个用户控件都绑定到一个视图模型。有时,当对一个用户控件进行更改时,其他用户控件中的数据也需要更新。我一直在考虑在 Prism 中使用事件聚合器,但实际上并不想将所有内容都转换为 shell、模块等。有没有什么方法可以让我在不使用 Prism 的情况下添加事件聚合?

I have an existing Silverlight application where Page.xaml has some buttons on it that load user controls into a TransitioningContentControl content host. Each of these user controls is bound to a viewmodel. Sometimes when changes are made to one user control, data in others would need to be updated. I have been looking at using the event aggregator in Prism but don't really want to have to convert everything to a shell, modules etc. Is there any way for me to add event aggregation without going to Prism?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(2

╭ゆ眷念 2024-08-26 07:31:00

您可以单独使用 Prism 中的 EventAggregator - 无需对应用程序进行任何更改即可容纳它 - 或者您也可以使用 Messenger 等替代方案="http://www.galasoft.ch/mvvm/getstarted/" rel="nofollow noreferrer">MVVM Light 工具包。更多替代方案和讨论的链接可以在 杰里米·D·米勒的博客

You can use the EventAggregator from Prism on its own - no changes to your application are required to accommodate it - or you could use an alternative such as Messenger from the MVVM Light Toolkit. Links to further alternatives and discussion can be found on Jeremy D. Miller's blog.

云之铃。 2024-08-26 07:31:00

您可以在事件聚合快速入门中找到一个示例

You can find one example here at Event Aggregation QuickStart

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