Hello,
I believe you are refering that Modules initialization fires and subscribes to Events instead of Regions, is this right?
Therefore, if I understood correctly, you are trying to Publish an Event from one Module's initialization where Region1 get the Views registered, and then you would be subscribing to that Event on another Module's Initialize() method where a Region2 is loaded with the corresponding views.
In this case, the Event would be Published, but it would not be handled because the Subscriber's Module instance dies after the initialize() action is complete. If you want to keep the subscription alive, then you should implement it on a particular ViewModel for example which it would keep the reference alive.
On the other hand, if you would need to subscribe to an Event during initialization, then a Shared object would be needed in order to work as an auxiliar interlocutor between both Modules. However, subscribing to an event on a Module initialization, gives me the idea that something may not be correctly designed.
If you would give me more details of the scenario you are trying to accomplish, I would give you better support to solve it.
Regards.
Gabriel Ostrowsky
https://blogs.southworks.net/gostrowsky
I believe you are refering that Modules initialization fires and subscribes to Events instead of Regions, is this right?
Therefore, if I understood correctly, you are trying to Publish an Event from one Module's initialization where Region1 get the Views registered, and then you would be subscribing to that Event on another Module's Initialize() method where a Region2 is loaded with the corresponding views.
In this case, the Event would be Published, but it would not be handled because the Subscriber's Module instance dies after the initialize() action is complete. If you want to keep the subscription alive, then you should implement it on a particular ViewModel for example which it would keep the reference alive.
On the other hand, if you would need to subscribe to an Event during initialization, then a Shared object would be needed in order to work as an auxiliar interlocutor between both Modules. However, subscribing to an event on a Module initialization, gives me the idea that something may not be correctly designed.
If you would give me more details of the scenario you are trying to accomplish, I would give you better support to solve it.
Regards.
Gabriel Ostrowsky
https://blogs.southworks.net/gostrowsky