using LogoForceTestApp.Modules.MainModule.Views; using LogoForceTestApp.Services; using LogoForceTestApp.Core; using Prism.Ioc; using Prism.Modularity; using Prism.Regions; using StatementMachineService.Core; using AutoMapper; using LogForceTestApp.Modules.MainModule; using AutoMapper.EquivalencyExpression; using LogoForceTestApp.Modules.MainModule.Services; namespace LogoForceTestApp.Modules.MainModule { public class MainModule : IModule { private readonly IRegionManager _regionManager; public MainModule(IRegionManager regionManager, IMapper mapper) { _regionManager = regionManager; } //启动时 page public void OnInitialized(IContainerProvider containerProvider) { _regionManager.RequestNavigate(RegionNames.ContentRegion, "MainPage", c => { }); } public void RegisterTypes(IContainerRegistry containerRegistry) { containerRegistry.RegisterSingleton(); containerRegistry.RegisterDialog(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterForNavigation(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); containerRegistry.RegisterSingleton(); var configuration = new MapperConfiguration(cfg => { cfg.AddCollectionMappers(); cfg.AddProfile(new MainModuleProfile()); }); containerRegistry.RegisterInstance(typeof(IMapper), new Mapper(configuration)); } } }