List of Objects put into the DI Container

Topics: Prism v4 - Silverlight 4, Prism v4 - WPF 4
Apr 8, 2011 at 4:10 PM
Edited Apr 8, 2011 at 4:29 PM

I may have missed it, but is there a list of the objects that Prism registers into the Unity Container somewhere in the documentation? 

Things like the Region Manager, Event Aggregator, Unity itself, etc...

Just trying to do some documentation as to what was available to developers for injection already and I couldnt find a list.

(edit)

I found the following code in the UnityBootstrapper.cs file, ConfigureContainer method.

                RegisterTypeIfMissing(typeof(IServiceLocator), typeof(UnityServiceLocatorAdapter), true);
                RegisterTypeIfMissing(typeof(IModuleInitializer), typeof(ModuleInitializer), true);
                RegisterTypeIfMissing(typeof(IModuleManager), typeof(ModuleManager), true);
                RegisterTypeIfMissing(typeof(RegionAdapterMappings), typeof(RegionAdapterMappings), true);
                RegisterTypeIfMissing(typeof(IRegionManager), typeof(RegionManager), true);
                RegisterTypeIfMissing(typeof(IEventAggregator), typeof(EventAggregator), true);
                RegisterTypeIfMissing(typeof(IRegionViewRegistry), typeof(RegionViewRegistry), true);
                RegisterTypeIfMissing(typeof(IRegionBehaviorFactory), typeof(RegionBehaviorFactory), true);                
                RegisterTypeIfMissing(typeof(IRegionNavigationJournalEntry), typeof(RegionNavigationJournalEntry), false);
                RegisterTypeIfMissing(typeof(IRegionNavigationJournal), typeof(RegionNavigationJournal), false);
                RegisterTypeIfMissing(typeof(IRegionNavigationService), typeof(RegionNavigationService), false);
                RegisterTypeIfMissing(typeof(IRegionNavigationContentLoader), typeof(RegionNavigationContentLoader), true);                

Can I assume that these are it?  Or should I look elsewhere too. 

Thanks

Paul

Apr 11, 2011 at 3:25 PM

Hi Paul,

The UnityBootstrapper´s ConfigureContainer method registers all the services that the UnityContainer will use in your application, as you mentioned. These are the core Prism services your application will use by default. You can also turn off registering any services by default, using the overloaded Bootstrapper.Run method passing in false value. But if you turn off the default registration, you will need to manually register required services.

You can read more about these topics in Chapter 2: Initializing Prism Applications

I hope you find this information useful.

Thanks,

Miguel Bronzovic
http://blogs.southworks.net/mbronzovic

Apr 11, 2011 at 4:07 PM

Yup, thats the part in the documentation I missed. 

thanks

Paul