WPF应用程序中的EventAgregator和Prism [英] EventAgregator and Prism in WPF app

查看:70
本文介绍了WPF应用程序中的EventAgregator和Prism的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的,

我在WPF应用程序中使用Prism事件聚合器,我们遇到了一个奇怪的问题。

I am using Prism event aggregator in our WPF application and we face a wierd issue.

我的模块在我的控件构造函数中注册实际上有2个事件聚合器,它有自己的处理程序。

My module is register to actually 2 event aggregator in my control constructor which have their own handler.

Event_1Handler()和Event_2Handler()

Event_1Handler() and Event_2Handler()

发生的事情是另一个wpf模块首先引发Event2然后在某个其他点引发Event1。

What is happening is that an other wpf module is raising first the Event2 and then at some other point is raising Event1.

但是发生的事情是第一个事件处理程序是catch,然后是Event_1Handler()但它的第二个事件的接收中断了执行事件  Event_2Handler()。

But what occurs is that the first event handler which is catch is then Event_1Handler() but its execution is interrupted by the receive of second event Event_2Handler() .

我理解事件是以某种方式排队的,一个事件的过程不能被另一个事件中断,是否会发生棱镜有什么不同?

I understand that event are queue in a way and a process of one event cannot be interrupted by another event, does it happen differently in prism ?

我知道为什么我的第一个事件处理程序处理被第二个处理程序的接收中断了?

Any idea why my first event handler processing is interrupted by the receive of second handler ?

Hoy要解决?

问候

推荐答案

嗨wakef un,

Hi wakefun,

>>知道为什么我的第一个事件处理程序处理被第二个处理程序的接收中断了吗?

>>Any idea why my first event handler processing is interrupted by the receive of second handler ?

我不确定是什么被另一个事件打断了。你取消订阅活动吗?它会抛出任何异常吗你能不能提供更多的信息,比如简单的演示,可以重现这个问题。

I am not sure what is interrupted by another event. do you unsubscribe from the event. does it throw any exception. could you please provide a bit more information, such as a simple demo, which could reproduce the issue.

此外,由于这是一个prsim问题,您还可以通过以下链接发布帖子。

In addition, since it is a prsim issue, you could also post a thread via the following link.

http://prismlibrary.github.io/docs/wpf/Appendix-B-Patterns.html

http://prismlibrary.github.io/docs/wpf/Appendix-B-Patterns.html

祝你好运,

张龙


这篇关于WPF应用程序中的EventAgregator和Prism的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆