tags:

views:

300

answers:

2

I am developing a WPF application using the CAG from Prism. What I want to achieve is create new instances of a module (ModuleA) and load them in a TabControl. I am able to instantiate the modules using the moduleInfo object and loading them through the Assembly and calling the CreateModule(type) method.

I can actually see the different modules in the UI, but the problem is when I start interacting with the different modules (for e.g. loading or unloading views in scoped regions) all the activity seems to happen only on the last loaded modules.

So for e.g. I have 2 'instances' of ModuleA as 2 TabItems and they both have command buttons to Load() new views. When I select the first Module (by selecting the first TabItem) and click the button to laod the view, the view gets loaded in the second module.

Anyone know how to sort this problem? Makes me believe, even if I 'see' two seperate modules on the UI, there is actually only one instance or the CreateModule creates clones ?

Anyone ? all help appreciated !

A: 

a question though, do you really need to create that tab as a module? do you intend to use that tab in different part of your application?

nothix9
+1  A: 

Hi,

As Erik explained, loading Modules and Views are very different concepts in Prism.

The following threads are useful when understanding this and deal with a scenario similar to the one from the question:

I hope this is useful.

Thanks, Damian

Damian Schenkelman