InterTabClient.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using Dragablz;
  8. using PDF_Office.Views;
  9. using Prism.Ioc;
  10. using Prism.Regions;
  11. namespace PDF_Office.CustomControl.SystemControl
  12. {
  13. public class InterTabClient : IInterTabClient
  14. {
  15. private IContainerProvider containerProvider;
  16. public InterTabClient(IContainerProvider container)
  17. {
  18. containerProvider = container;
  19. }
  20. public INewTabHost<Window> GetNewHost(IInterTabClient interTabClient, object partition, TabablzControl source)
  21. {
  22. var view = containerProvider.Resolve<MainWindow>();
  23. var regionManager = containerProvider.Resolve<IRegionManager>();
  24. RegionManager.SetRegionManager(view, regionManager);
  25. RegionManager.UpdateRegions();
  26. return new NewTabHost<Window>(view, view.TabablzControl);
  27. }
  28. public TabEmptiedResponse TabEmptiedHandler(TabablzControl tabControl, Window window)
  29. {
  30. return TabEmptiedResponse.CloseWindowOrLayoutBranch;
  31. }
  32. }
  33. }