12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- 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<InovanceTcp>();
- containerRegistry.RegisterDialog<OeeDialogPage>();
- containerRegistry.RegisterForNavigation<OperationLogPage>();
- containerRegistry.RegisterForNavigation<MainPage>();
- containerRegistry.RegisterForNavigation<LogPage>();
- containerRegistry.RegisterForNavigation<DataPage>();
- containerRegistry.RegisterForNavigation<LoginPage>();
- containerRegistry.RegisterForNavigation<OeeDebugPage>();
- containerRegistry.RegisterForNavigation<ParamPage>();
- containerRegistry.RegisterForNavigation<QualityTracing>();
- containerRegistry.RegisterForNavigation<SignInPage>();
- containerRegistry.RegisterSingleton<IStateService, StateService>();
- containerRegistry.RegisterSingleton<IScanService, ScanService>();
- containerRegistry.RegisterSingleton<IWarningUpdateService, WarningUpdateService>();
- var configuration = new MapperConfiguration(cfg =>
- {
- cfg.AddCollectionMappers();
- cfg.AddProfile(new MainModuleProfile());
- });
- containerRegistry.RegisterInstance(typeof(IMapper), new Mapper(configuration));
- }
- }
- }
|