Created
March 21, 2011 22:26
-
-
Save Jonsey/880363 to your computer and use it in GitHub Desktop.
Module initialisation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class InventoryModule : IModule | |
| { | |
| protected IUnityContainer container; | |
| protected IRegionManager regionManager; | |
| protected InventoryModule(IUnityContainer container, IRegionManager manager) | |
| { | |
| this.container = container; | |
| regionManager = manager; | |
| } | |
| protected override void RegisterTypesAndServices() | |
| { | |
| container | |
| .RegisterType<IInventoryRepository, InventoryRepository>() | |
| .RegisterType<ICountriesRepository, CountriesRepository>(); | |
| container | |
| .RegisterType<IMainMenuViewModel, MainMenuViewModel>(new ContainerControlledLifetimeManager()) | |
| .RegisterType<IMainMenuView, MainMenuView>(new ContainerControlledLifetimeManager()); | |
| } | |
| protected override void RegisterViewsWithRegions() | |
| { | |
| regionManager.RegisterViewWithRegion("TopRegion", typeof(MainMenuView)); | |
| regionManager.RegisterViewWithRegion("RightRegion", typeof(IInventoryView)); | |
| } | |
| public void Initialize() | |
| { | |
| RegisterTypesAndServices(); | |
| RegisterViewsWithRegions(); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment