S7NetModuleModule.cs 1004 B

123456789101112131415161718192021222324252627282930
  1. using Prism.Ioc;
  2. using Prism.Modularity;
  3. using Prism.Regions;
  4. using S7NetModule.Services;
  5. using S7NetModule.ViewModels;
  6. using S7NetModule.Views;
  7. namespace S7NetModule
  8. {
  9. public class S7NetModuleModule : IModule
  10. {
  11. public void OnInitialized(IContainerProvider containerProvider)
  12. {
  13. var regionManager = containerProvider.Resolve<RegionManager>();
  14. regionManager.RegisterViewWithRegion("EditRegion", typeof(S7NetView));
  15. regionManager.RegisterViewWithRegion("EditRegion", typeof(S7ReadlView));
  16. regionManager.RegisterViewWithRegion("EditRegion", typeof(S7WriteView));
  17. }
  18. public void RegisterTypes(IContainerRegistry containerRegistry)
  19. {
  20. containerRegistry.RegisterSingleton<S7ReadlView>();
  21. containerRegistry.RegisterSingleton<S7WriteView>();
  22. containerRegistry.RegisterSingleton<S7NetView>();
  23. containerRegistry.RegisterSingleton<S7NetViewModel>();
  24. }
  25. }
  26. }