TcpServerModuleModule.cs 625 B

12345678910111213141516171819202122
  1. using Prism.Ioc;
  2. using Prism.Modularity;
  3. using Prism.Regions;
  4. using TcpServerModule.Views;
  5. namespace TcpServerModule
  6. {
  7. public class TcpServerModuleModule : 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. }