event subscription after new module is created

Topics: Prism v4 - Silverlight 4
Jan 31, 2013 at 9:10 AM
Edited Feb 5, 2013 at 7:14 PM
Feb 1, 2013 at 11:26 AM

Based on my understanding of your scenario, what you experiencing is a timing issue as you should be subscribed to this event before this is being published in order to receive the corresponding selectedProduct. For example, as as possible approach in order to ensure this, I believe you could set ModuleA to have a dependency on ModuleB, this way you will ensure that ModuleB will be subscribed to this event before the products are selected from the list in ModuleA.
On the other hand, if this is not possible for your scenario, so far the only alternative I could think of, is to have a shared service to store the current selectedProduct this way when your ModuleB is loaded you could retrieve the selectedProduct so the initialization is performed as expected.

I hope you find this handy,

Agustin Adami