How to invoke view of another module from a view of one module in Prism?
Hi all, I need to invoke a view of another module from a view of one module, for example, I have two mdi windows which contain different views from two modules. one has a grid that lists all orders, when user click one item of it, another mdi winodw that contains
the order detail view from another module will display. how to make thisin Prism?
Could some help me?
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:
. This way, you could call the
method from the region manager to show a view from a another module like this:
regionManager.RequestNavigate("MainRegion", new Uri("YourView", UriKind.Relative));
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
Like this in Unity
Or like this in MEF
public partial class YourView : UserControl
to your ViewModels
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
Hope this helps,