I use EventAggregator to publish an event, it works well with one channel, but when I specify two channels, the event cann't be triggered. Here's the code:
public class ShellViewModel : Screen
{
public ShellViewModel(IEventAggregator eventAggregator)
{
new A(eventAggregator);
// eventAggregator.Publish("Hello", "AChanel"); // This is ok
eventAggregator.Publish("Hello", "AChanel", "BChanel"); // This can't trigger
}
}
public class A : IHandle<string>
{
public A(IEventAggregator eventAggregator)
{
eventAggregator.Subscribe(this, "AChanel");
}
public void Handle(string message)
{
MessageBox.Show(message);
}
}
I noticed that If I Subscribe(this, "AChanel", "BChanel"), it can work.
But it's weired using channel like this, because I only care about "AChanel".
Hi
I use EventAggregator to publish an event, it works well with one channel, but when I specify two channels, the event cann't be triggered. Here's the code:
I noticed that If I
Subscribe(this, "AChanel", "BChanel")
, it can work. But it's weired using channel like this, because I only care about "AChanel".