Prism eventAggregator . how publish/subscribe from one module to mutiple module

Topics: Prism v2 - WPF 4, Prism v4 - WPF 4
Aug 22, 2012 at 9:36 PM
Edited Aug 22, 2012 at 9:38 PM

Hi ,

I have question , about publish and subscribe,

i have one page where my tabs , from this page i want to open different module,

by tab i know which module i need to open,

but if i pusblish my main page to other module my all module get subscribe, dont know how to do it?

any one know.

i dont want to created same event Type on many pages .



Aug 23, 2012 at 1:57 PM


I'm not sure if I understood your scenario correctly, but I believe you could benefit from using Subscription Filtering with your events, which lets you pass a filter parameter, to avoid that all subscribers handle every instance of the published event. This way you could create one event type defined in a common project that will be referenced by the modules that will consume it, and based on the payload passed when publishing to the event you will define which module will handle the event.

You could find more information about this in the following section of the Prism documentation:

Also, for an example that uses a custom payload and subscribes using a a filter expression you could check the Event Aggregation QuickStart.

Please let me know if I have misunderstood your scenario,

Agustin Adami

Aug 23, 2012 at 6:48 PM

Thanks Agustin,

below my scenario,

I have menu like ribbon Control.

and when i clcik Tab 1 then Tab1 user controls should open , and Tab 2 and other page should open and subscribe how i can do.