Exemple #1
0
 public TabGroup(TabGroupManager tabGroupManager, IMenuManager menuManager, IWpfFocusManager wpfFocusManager, TabGroupManagerOptions options)
 {
     this.options = options;
     this.tabContentAttached = new WeakEventList<TabContentAttachedEventArgs>();
     this.tabGroupManager = tabGroupManager;
     this.wpfFocusManager = wpfFocusManager;
     this.tabControl = new TabControl();
     this.tabControl.DataContext = this;
     tabControl.SetStyle(options.TabControlStyle ?? "FileTabGroupTabControlStyle");
     this.tabControl.SelectionChanged += TabControl_SelectionChanged;
     if (options.InitializeContextMenu != null)
         this.contextMenuCreator = options.InitializeContextMenu(menuManager, this, this.tabControl);
     else if (options.TabGroupGuid != Guid.Empty)
         this.contextMenuCreator = menuManager.InitializeContextMenu(this.tabControl, options.TabGroupGuid, new GuidObjectsCreator(this));
 }
Exemple #2
0
		public TabGroup(TabGroupService tabGroupService, IMenuService menuService, IWpfFocusService wpfFocusService, TabGroupServiceOptions options) {
			this.options = options;
			tabContentAttached = new WeakEventList<TabContentAttachedEventArgs>();
			this.tabGroupService = tabGroupService;
			this.wpfFocusService = wpfFocusService;
			tabControl = new TabControl();
			tabControl.DataContext = this;
			tabControl.SetStyle(options.TabControlStyle ?? "FileTabGroupTabControlStyle");
			tabControl.SelectionChanged += TabControl_SelectionChanged;
			tabControl.PreviewKeyDown += TabControl_PreviewKeyDown;
			if (options.InitializeContextMenu != null)
				contextMenuProvider = options.InitializeContextMenu(menuService, this, tabControl);
			else if (options.TabGroupGuid != Guid.Empty)
				contextMenuProvider = menuService.InitializeContextMenu(tabControl, options.TabGroupGuid, new GuidObjectsProvider(this));
		}