Prism-MEF Splash screen Module

Topics: Prism v4 - WPF 4
Mar 24, 2013 at 9:11 AM
Hi,
I followed the demo in the follwing link to create Module for splash screen using MEF:

https://skydrive.live.com/?cid=74ca25f347d34be2&id=74CA25F347D34BE2%21341&sc=documents

i tried to customize it for MEF instead of Unity but couldn't do it esp. in the MEF Bootstrapper
could you please show me how to customize the Splash Screen module and the Bootstrapper module for MEF.
Thanks in advance.
Mar 25, 2013 at 7:32 PM
Edited Mar 26, 2013 at 2:26 PM
Hi,

We took the sample you provided and made changes to it in order to be able to use MEF, some of which include the following:
  • Migrated application from Prism 2.0 to Prism 4.1
  • Changed Bootstrapper to aggregate modules using MEF
  • Added ModuleExport, Export and ImportingConstructor attributes to the corresponding types
  • Removed the manual module initialization from the Bootstrapper (the initialization should be done automatically by the ModuleCatalog)
  • Made modules dependent of the Splash Module, to avoid having them being initialized before it
  • Events that were published on the Bootstrapper were moved to their corresponding Modules
Also we found the following issues that we changed to follow the best practices:
  • Registering types against themselves like this: Container.RegisterType<SplashViewModel, SplashViewModel>();
  • Manual initialization of modules in Bootstrapper. Modules should have an Initialize method.
You can find the sample below:

Prism Splash sample (Prism 4.1)

Hope this helps,

Federico Martinez
http://blogs.southworks.net/fmartinez
Mar 25, 2013 at 8:58 PM
Hi Federico,
Thanks for your effort but please load the MEF sample you modified into Skydrive because the sample there is the old one (Unity)******
Mar 26, 2013 at 7:28 AM
Hi Federico,
Please load the MEF sample you modified into Skydrive because the sample there is the old one (Unity)???????????????
Mar 26, 2013 at 2:24 PM
Hi,

Sorry about that. I have re-uploaded the sample in my SkyDrive account. You can find it with the name of PrismSplash with MEF(4.1):

PrismSplash with MEF(4.1)

I hope you find it useful,

Federico Martinez
http://blogs.southworks.net/fmartinez