Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8709313
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T04:20:15+00:00 2026-06-13T04:20:15+00:00

I am trying to understanding the Event Aggregator pattern from an architecture and design

  • 0

I am trying to understanding the Event Aggregator pattern from an architecture and design view point. I have never used Prism in WPF before, but I’m studying how it works on MSDN.

It seems to me that for every event, the user has to create a new event object that extends the CompositePresentationEvent. It also appears that the new event object has no functionality other than those it inherited from (it usually has no code for itself).

So for example:

A AddNewStuffEvent would look like:

public class AddNewStuffEvent : CompositePresentationEvent<Object> {} //The end of the class

For a HealthChangeEvent:

public class HealthChangeEvent: CompositePresentationEvent<Object> {} //The end of the class

For a BookFlipEvent:

public class BookFlipEvent: CompositePresentationEvent<Object> {} //The end of the class

For a BookCloseEvent:

public class BookCloseEvent: CompositePresentationEvent<Object> {} //The end of the class

And this can go on forever for every little small event for BookOpenEvent, BookTearEvent, etc. So, in a particular namespace folder, there will be a whole ton of event classes, and the Event Aggregator is going to be loaded with all these event objects during runtime. That’s, every little small event needs an empty class? Is this how it works? What could be a better way for this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T04:20:16+00:00Added an answer on June 13, 2026 at 4:20 am

    Yes, every event type needs its own class, which you have to define.

    It also appears that the new event object has no functionality other than those it inherited from

    The purpose is simply to provide strong typing for the event. This makes it easier to write code to subscribe to them. Ie, the subscribing code can be written like:

    aggregator.GetEvent<AddNewStuffEvent>().Subscribe(Handler);
    

    This is a preferable approach to alternatives, such as reliance on “magic strings” in the form of say aggregator.GetEvent("AddNewStuffEvent").Subscribe(Handler) (which could not be verified at compile time.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to grok get a preliminary understanding of monads. I have a
I'm trying to see if I have a correct understanding of prefetching with Core
I have been trying out Cassandra and need some help in understanding a few
I have a question about the event dispatch. I am trying to write the
I am trying to have my program able to read in data from a
I'm trying to pin down my understanding of sequence points in C -- just
I've been trying to gain a deeper understanding of how compilers generate machine code,
I'm trying to gain a basic understanding of what is meant by a Windows
I'm trying to get a better understanding than I've been able to so far...it's
I am trying to get a basic understanding on how to use fputc in

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.