Pop up Window

Topics: Prism v4 - Silverlight 4
Dec 27, 2010 at 5:24 PM
Edited Dec 27, 2010 at 5:25 PM

I have a region defined inside a Third party Child Window. The child window is instantiated in the shell by subscribing to an event. The region is defined in ModuleA which has content for this child window. How can I get the parameters from the event subscription in this ModuleAViewModel from the shell.


example shell:


 public Shell(IEventAggregator aggregator)
            this.aggregator = aggregator;

        public void ShowRadWindow(string commandName)
             MyRadWindow obj = new MyRadWindow();



How can I either subscribe to this event in ModuleAViewModel or have access to string commandName? 


Dec 27, 2010 at 6:28 PM


As explained in this chapter from the Prism MSDN documentation, the Event Aggregator provides multicast eventing functionality between loosely coupled components. That is to say, you could subscribe to an event in several components, all of which will recibe the event simultaneously. So, you could import the Event Aggregator in your view model and subscribe to the event, as you're doing in your shell.

Additionally, if you need to inject different views inside a region and switch between them based on the application's flow, you might find Prism Navigation useful to your scenario.

I hope you find this helpful.

Guido Leandro Maliandi

Dec 27, 2010 at 8:10 PM
Edited Dec 27, 2010 at 8:10 PM

Thanks. I was trying to do that however I wasn't able to trigger the method on the child window. I had to move MyRadWindow instantiation in the public shell and that worked.