从delegatecommand-prism发布事件

本文关键字:事件 布事件 delegatecommand-prism | 更新日期: 2023-09-27 18:27:00

我有一个事件订阅

 this.eventAggregator.GetEvent<BusyEvent>().Subscribe(this.HandleBusyEvent, ThreadOption.UIThread, false);

但是,当我尝试从delegatecommand操作发布事件时,该事件不会被激发。是否有任何已知的限制阻止此操作。

this.eventAggregator.GetEvent<BusyEvent>().Publish(false);

从delegatecommand-prism发布事件

从委托命令触发事件没有限制。我经常这样做,用户从UI调用命令,视图模型中的相关命令操作使用棱镜事件聚合器发布事件。