I have a TestEvent class as follows:
class TestEvent: CompositePresentationEvent<object>
{
public void Subscribe(Action<object> action, int number)
{
this.Subscribe(action, ThreadOption.PublisherThread, false, arg=>arg.Equals(number));
}
}
If I signed up for the event as follows:
eventAggregator.GetEvent<TestEvent>().Subscribe(_=>MessageBox.Show("Hi"), 3);
The event does not fire. However, if I signed it like this:
eventAggregator.GetEvent<TestEvent>().Subscribe(_ => MessageBox.Show("Hi"), ThreadOption.PublisherThread, false, arg => arg.Equals(3));
This is fire. Although conceptually, syntactically and logically, both are similar. The only difference is that the former uses a helper method in the event class to subscribe to the event.
, , CompositeEvent, , keepSubscriberAlive = true ( ) . , , ? , ? , false, / ?
- ?