When using Prism's EventAggregator
-class you will need to fulfill vertain requirements:
Define an event that derives from
CompositePresentationEvent<TEventArgs>
, whereTEventArgs
derives fromSystem.EventArgs
Define a public method that handles your event, taking an instance of
TEventArgs
as parameter; for example:public void HandleExceptionEvent(ExceptionEventArgs eventArgs) { }
The method needs to be public because otherwise the
EventAggregator
won't be able to invoke that method.Subscribe to your event:
evntAgg.GetEvent<ExceptionEvent>.Subscribe(HandleExceptionEvent);
Given that you have implemented step 2 as described that should work without a problem.