c# - Caliburn.Micro EventAggregator with multiple instances -


i have 2 caliburn.micro viewmodels communicating each other eventaggregator:

public class leftviewmodel {     // ...     public void doinright()     {         messanger.publishonuithread(new doinrightmessage());     } }  public class rightviewmodel : ihandle<doinrightmessage> {     public void handle(doinrightmessage e)     {         // ...     } } 

it has worked fine until had 1 instance of leftviewmodel , righviewmodel on screen. allow arbitrary number of instances of both of them - in couples. leftviewmodel.doinright() should send message in 1 righviewmodel (the 1 in couple), not righviewmodel instances.

update 8.7.2015: how solve such pair messaging:

  • some kind of message channels/groups adding parameter target or id messages (thanks @jophy job point me idea).
  • have multiple eventaggregators.
  • abandon eventaggregator , call methods directly.
  • or other solution?

you can try using sort of id every view.

there similar question caliburn.micro , event aggregator -unwanted call handle method


Comments

Popular posts from this blog

toolbar - How to add link to user registration inside toobar in admin joomla 3 custom component -

linux - disk space limitation when creating war file -