Example #1
0
        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            BootsrapperMessageAction?.Invoke("Register Types");
            //Register TypesContainer that represent IUnityContainer
            containerRegistry.RegisterSingleton <ITypesContainer, TypesContainer>();
            containerRegistry.RegisterSingleton <IMainMenuService, MainMenuService>();
            containerRegistry.RegisterSingleton <IFlyoutService, FlyoutService>();

            StaticContainer.SetContainer(Container.Resolve <ITypesContainer>());
            containerRegistry.RegisterInstance(DialogCoordinator.Instance);
            containerRegistry.Register <IDeviceDefinitionViewModel, DeviceDefinitionViewModel>();
            containerRegistry.RegisterInstance <IApplicationSettingsService>(new ApplicationSettingsService());
            containerRegistry.RegisterInstance(new ShellSettingsViewModel(StaticContainer.Container));
            containerRegistry.Register <RecentProjectsViewModelFactory>();
            //регистрация вью-моделей
            containerRegistry.Register <Views.Shell>();
            //StaticContainer.Container.RegisterViewModel<Views.Shell, ShellViewModel>();
            StaticContainer.Container.RegisterViewModel <ShellSettingsFlyOut, ShellSettingsViewModel>();
            containerRegistry.RegisterInstance(new DynamicMainMenuViewModel());
            containerRegistry.RegisterInstance(typeof(IGlobalEventManager), new GlobalEventManager(Container.Resolve <IEventAggregator>()));

            StaticContainer.Container.Register <ShellViewModel>(true);


            //модули
            RegisterModuleCatalogs(StaticContainer.Container);
            InitializeUnityModules();
        }