TcpModbusMasterModuleModule.cs 643 B

12345678910111213141516171819202122
  1. using Prism.Ioc;
  2. using Prism.Modularity;
  3. using Prism.Regions;
  4. using TcpModbusMasterModule.Views;
  5. namespace TcpModbusMasterModule
  6. {
  7. public class TcpModbusMasterModuleModule : IModule
  8. {
  9. public void OnInitialized(IContainerProvider containerProvider)
  10. {
  11. var regionManager = containerProvider.Resolve<RegionManager>();
  12. regionManager.RegisterViewWithRegion("ContentRegion", typeof(ViewA));
  13. }
  14. public void RegisterTypes(IContainerRegistry containerRegistry)
  15. {
  16. // 注册服务为单例
  17. containerRegistry.RegisterSingleton<Service>();
  18. }
  19. }
  20. }