HichemSeeSharp
HichemSeeSharp

Reputation: 3318

Navigating to a view of a module from another module in prism

I'm building a little complex prism application. Customer requirements obliges me to utilize ModuleA features in ModuleB.

My question is whether it is breaking prism's decoupling purpose when I reference ModuleA namespace in ModuleB and navigate to its views. If yes then how can I resolve this ?

Upvotes: 1

Views: 1295

Answers (2)

Louis Kottmann
Louis Kottmann

Reputation: 16648

You need to use the IEventAggregator and publish/subscribe to weak events (CompositePresentationEvent<TPayload>) through it.

Here is a sample.

Here is the relevant msdn link.

Upvotes: 0

Jon
Jon

Reputation: 437854

The two incarnations of the RequestNavigate method (which is the recommended way to begin navigation) intentionally specify views as URIs specifically so that the actual type of the view does not need to be specified inside module code.

Resolution of the actual types from names and of instances from the types is done by the region manager and the container respectively, both of which are configured during the application's bootstrap sequence and do not belong to any specific module.

How exactly are you currently navigating across module boundaries?

Upvotes: 1

Related Questions