I am trying to understand an event aggregator pattern in terms of architecture and design. I have never used Prism in WPF before, but I am learning how it works on MSDN.
It seems to me that for each event, the user should create a new event object that extends CompositePresentationEvent . It also seems that the new event object has no functions other than those for which it has inherited (it usually does not have code for itself).
So for example:
A AddNewStuffEvent will look like this:
public class AddNewStuffEvent : CompositePresentationEvent<Object> {}
With a HealthChangeEvent :
public class HealthChangeEvent: CompositePresentationEvent<Object> {}
With a BookFlipEvent :
public class BookFlipEvent: CompositePresentationEvent<Object> {}
With a BookCloseEvent :
public class BookCloseEvent: CompositePresentationEvent<Object> {}
And this can go on forever for every little little event for BookOpenEvent , BookTearEvent , etc. Thus, in a particular namespace folder there will be a whole ton of event classes, and the event aggregator will load with all these event objects at run time. That is, every little little event needs an empty class? Does this work? What could be the best way to do this?
source share