public ITabGroupService Create(TabGroupServiceOptions options = null) { var mgr = new TabGroupService(this, menuService, wpfFocusService, options); tabGroupServices.Add(mgr); if (selectedIndex < 0) selectedIndex = 0; return mgr; }
internal void SetActive(TabGroupService tabGroupService) { int index = tabGroupServices.IndexOf(tabGroupService); Debug.Assert(index >= 0); if (index >= 0) { selectedIndex = index; } }
public ITabGroupService Create(TabGroupServiceOptions options = null) { var mgr = new TabGroupService(this, menuService, wpfFocusService, options); tabGroupServices.Add(mgr); if (selectedIndex < 0) { selectedIndex = 0; } return(mgr); }
public TabGroup(TabGroupService tabGroupService, IMenuService menuService, IWpfFocusService wpfFocusService, TabGroupServiceOptions options) { this.options = options; this.tabContentAttached = new WeakEventList <TabContentAttachedEventArgs>(); this.tabGroupService = tabGroupService; this.wpfFocusService = wpfFocusService; this.tabControl = new TabControl(); this.tabControl.DataContext = this; this.tabControl.SetStyle(options.TabControlStyle ?? "FileTabGroupTabControlStyle"); this.tabControl.SelectionChanged += TabControl_SelectionChanged; this.tabControl.PreviewKeyDown += TabControl_PreviewKeyDown; if (options.InitializeContextMenu != null) { this.contextMenuProvider = options.InitializeContextMenu(menuService, this, this.tabControl); } else if (options.TabGroupGuid != Guid.Empty) { this.contextMenuProvider = menuService.InitializeContextMenu(this.tabControl, options.TabGroupGuid, new GuidObjectsProvider(this)); } }
internal void SetActive(TabGroupService tabGroupService) { int index = tabGroupServices.IndexOf(tabGroupService); Debug.Assert(index >= 0); if (index >= 0) selectedIndex = index; }
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)); }