As far as I know, if all event subscribers use the parameter ThreadOption.PublisherThread(which is also the default), the event is executed synchronously and the subscribers can modify the object EventArgsso that you could have a publisher
myEventAggregator.GetEvent<MyEvent>().Publish(myParams)
if (myParams.MyProperty)
{
}
:
myEventAggregator.GetEvent<MyEvent>().Subscribe(MySubscribedMethod)
myEventAggregator.GetEvent<MyEvent>().Subscribe(MySubscribedMethod, ThreadOption.PublisherThread)
private void MySubscribedMethod(MyEventArgs e)
{
e.MyProperty = true;
}
, , ( CompositePresentationEvent<T>), Subscribe ThreadOption.PublisherThread, :
public class SynchronousEvent<TPayload> : CompositePresentationEvent<TPayload>
{
public override SubscriptionToken Subscribe(Action<TPayload> action, ThreadOption threadOption, bool keepSubscriberReferenceAlive, Predicate<TPayload> filter)
{
if (threadOption != ThreadOption.PublisherThread)
{
throw new InvalidOperationException();
}
return base.Subscribe(action, threadOption, keepSubscriberReferenceAlive, filter);
}
}
, MyEvent CompositePresentationEvent, SynchronousEvent, , EventArgs.