MainModule.cs 2.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. using LogoForceTestApp.Modules.MainModule.Views;
  2. using LogoForceTestApp.Services;
  3. using LogoForceTestApp.Core;
  4. using Prism.Ioc;
  5. using Prism.Modularity;
  6. using Prism.Regions;
  7. using StatementMachineService.Core;
  8. using AutoMapper;
  9. using LogForceTestApp.Modules.MainModule;
  10. using AutoMapper.EquivalencyExpression;
  11. using LogoForceTestApp.Modules.MainModule.Services;
  12. using LogoForceTestApp.Modules.MainModule.ViewModels;
  13. namespace LogoForceTestApp.Modules.MainModule
  14. {
  15. public class MainModule : IModule
  16. {
  17. private readonly IRegionManager _regionManager;
  18. public MainModule(IRegionManager regionManager, IMapper mapper)
  19. {
  20. _regionManager = regionManager;
  21. }
  22. public void OnInitialized(IContainerProvider containerProvider)
  23. {
  24. _regionManager.RequestNavigate(RegionNames.ContentRegion, "MainPage");
  25. }
  26. public void RegisterTypes(IContainerRegistry containerRegistry)
  27. {
  28. containerRegistry.RegisterSingleton<PLC>();
  29. containerRegistry.RegisterDialog<ChartPage1>();
  30. containerRegistry.RegisterDialog<ChartPage2>();
  31. containerRegistry.RegisterDialog<ChartPage3>();
  32. containerRegistry.RegisterForNavigation<OperationLogPage>();
  33. containerRegistry.RegisterForNavigation<MainPage>();
  34. containerRegistry.RegisterForNavigation<LogPage>();
  35. containerRegistry.RegisterForNavigation<DataPage>();
  36. containerRegistry.RegisterForNavigation<LoginPage>();
  37. containerRegistry.RegisterForNavigation<ParamPage>();
  38. containerRegistry.RegisterForNavigation<QualityTracing>();
  39. containerRegistry.RegisterForNavigation<SopPage>();
  40. containerRegistry.RegisterForNavigation<AccountPage>();
  41. containerRegistry.RegisterForNavigation<StatementPage>();
  42. containerRegistry.RegisterSingleton<IStateService, StateService>();
  43. containerRegistry.RegisterSingleton<IScanService, ScanService>();
  44. containerRegistry.RegisterSingleton<IWarningUpdateService, WarningUpdateService>();
  45. }
  46. }
  47. }