Hi,
Based on my understanding, modules can't communicate directly between them. So in my opinion, in order to accomplish this task you have two possible options:
1 - Use Navigation. This way, you could call the RequestNavigate method from the region manager to show a view from a another module like this:
Note that you only need to know both the region and the view names to navigate, so you don't require to have an explicit reference between the modules. Also, remember that in order to be able to navigate to a view in a region, that view should be registered in the container accordingly.
Like this in Unity:
Or like this in MEF:
2 - Inject EventAggregator to your ViewModels and use Publish and Subscribe methods to communicate between the modules.
For more information on Navigation and communicating between loosely coupled components, you can visit the following sections of the Prism documentation:
Federico Martinez
http://blogs.southworks.net/fmartinez
Based on my understanding, modules can't communicate directly between them. So in my opinion, in order to accomplish this task you have two possible options:
1 - Use Navigation. This way, you could call the RequestNavigate method from the region manager to show a view from a another module like this:
regionManager.RequestNavigate("MainRegion", new Uri("YourView", UriKind.Relative));
Like this in Unity:
container.RegisterType<object,YourView>("YourView");
[Export("YourView")] publicpartialclass YourView : UserControl
For more information on Navigation and communicating between loosely coupled components, you can visit the following sections of the Prism documentation:
- Chapter 8: Navigation - Basic Region Navigation
- Chapter 9: Communicating Between Loosely Coupled Components - Event Aggregation
Federico Martinez
http://blogs.southworks.net/fmartinez