It's great that you have been able to use the prism EventAggregator in a Winforms app! You might find
Glenn Block's post on
Bringing Prism to WinForms useful.
Back to your question. If I understood your scenario correctly, you need to have an operation (in this case saving) which can be canceled by decoupled entities. If this is the case, there is no out-of-the-box cancellable event in prism. Nevertheless, as
you said, you might implement a similar approach to winform's cancellable events by adding an
Cancelled property to the event payload: When an event is published by the EventAggregator, the same instance of the payload is used for all subscribed handlers. So you can set a property that indicates that the action should not be executed.
The following pseudo code could be used:
In the Subscribers:
public void OnContextSaving(SavingEventArg e)
e.Canceled = true;
In the publisher:
savingEventArg.Canceled = false;
// Do Saving
NOTE: for this approach to work properly you need to subscribe using the default thread option (ThreadOption.PublisherThread
There was a similar discussion on the SCSF about cancelling events. It's a different scanario, but same concepts might apply:
In the prism discussion there also another discussion that might be related (though not using eventAggregator):
Hope it helps!