On demand modules and EventAggregator

Topics: Prism v4 - Silverlight 4
Dec 1, 2010 at 3:11 PM


I have a modular application which loads modules on demand. The problem I came across is having one module throw an event through EventAggregator and some other module which is loaded only on demand to catch that event.

In other words, I need some non hacking way to load a module which needs that event (of course I need some way to know which module to load for which event) and then throw an event to that module. 

Also, I have a solution with navigating between on demand modules via silverlight navigation control, but I don't like it. I won't go into details here, but I want to know what is the best way to do this kind of navigation.

So any detailed guidance on how to go about these issues would be much appreciated!




Dec 1, 2010 at 7:35 PM

Hi Paulius,

I do not know your exact scenario, but based on my understanding your application raises an event from a module and it is necessary to handle this event from another module, which is loaded on demand.

Therefore, I think that you could specify a module dependency for achieving your scenario. For more information on this topic, you could take a look at the following documentation section on MSDN: Chapter 4: Modular Application Development, see the Specifying Module Dependencies section.

Hope this helps.

Fernando Antivero