简体   繁体   English

MVP演讲者和活动

[英]MVP Presenter and Events

I have three views, each of which is is implemented in a user control. 我有三个视图,每个视图都是在用户控件中实现的。 This all works fine when they are alone. 当他们一个人时,这一切都很好。 When an item is selected in view one I need to notify the other two views that the item that they are looking at has changed. 在视图中选择一个项目时,我需要通知其他两个视图他们正在查看的项目已更改。

I have looked at various ways of handling this but the one that keeps coming back as the better approach to me is to use events. 我已经研究了处理此问题的各种方法,但是随着对我来说更好的方法是使用事件,这种方法不断出现。 I was wondering if anyone had any samples of how to do this in terms of an EventAggrergator/ Application Controller pattern? 我想知道是否有人使用EventAggrergator / Application Controller模式就如何执行此操作有任何样本?

James :-) 詹姆士 :-)

这听起来像是应用观察者模式的不错选择。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM