Quantcast
Channel: patterns & practices: Prism
Viewing all articles
Browse latest Browse all 1878

New Post: Switch between Views in different Modules using Prism and Unity

$
0
0

Hi,

Based on my understanding of your scenario, it seems that you are not registering the ModuleBView to be used with navigation.

Basically, when performing a navigation request in a region, Prism will try to construct the corresponding view through the dependency injection container of your application (in this case Unity) using the view's name passed in the Uri. Hence, if the view is not registered with that name in the dependency injection container, Prism would not be able to resolve it and the navigation request would fail.

In order for a view to be used with navigation in Unity you need to register it like this:

container.RegisterType<object,ViewClass>("ViewClass");

For example, you can register the ModuleBView like this:

// Module Bpublicvoid Initialize()
{ 
    container.RegisterType<object,ModuleBView>("ModuleBView");
}

Doing this, you can navigate to different views in different modules without needing for the modules to know each other or their assemblies.

You can find more information about this in the following chapter of the Prism documentation:

I hope you find this useful,

Damian Cherubini
http://blogs.southworks.net/dcherubini


Viewing all articles
Browse latest Browse all 1878

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>