0

I am trying to load views and viewmodels in a module using app.config and Prism 7.1.0.279-pre. I cannot find any post anywhere that seems to get this to work. Does anyone have any examples?

I have a basic understanding from MEF when it was early on. I would like to be able to create apps with multiple reusable modules and would like to get this to work.

1 Answers1

0

You should use the ConfigurationModuleCatalog.

Therefore, you need a ModulesConfigurationSection in your app.config named modules. This is where you define the modules to load.

An example is in the documentation.

BTW - Prism 7 has dropped support for MEF. Use a container like unity or dryioc for dependency injection and reserve MEF for plugin system.

Haukinger
  • 10,420
  • 2
  • 15
  • 28
  • Actually I am using Unity I just remember briefly taking a look at MEF when it was young (in the early 2ks :)) I tried that but could not figure out if I was doing something wrong. I ended up adding the module to the catalog via AddModule. Not as loosely coupled as I would have hoped as I had to have a reference to the module in my shell. – Spursoft Solutions Oct 10 '18 at 23:47
  • The app.config stuff is as straight forward as possible, just the fully qualified type names look a bit intimidating. Have a look at my edit. – Haukinger Oct 11 '18 at 06:36
  • I don't get it. I have created the simplest app and module. At what point in the process would I be able to see the Modules count > 0 in the catalog? – Spursoft Solutions Oct 11 '18 at 15:47
  • So turns out if I roll back to 6.30 with a bootstrapper it works. 7 doesn't seem to be working. – Spursoft Solutions Oct 11 '18 at 17:11
  • So 7 works but not using PrismApplication but instead Using 7 with UnityBootStrapper it seems to work. – Spursoft Solutions Oct 11 '18 at 17:39