Beispiel #1
0
        public ITabGroupManager Create(TabGroupManagerOptions options = null)
        {
            var mgr = new TabGroupManager(this, menuManager, wpfFocusManager, options);

            tabGroupManagers.Add(mgr);
            if (selectedIndex < 0)
            {
                selectedIndex = 0;
            }
            return(mgr);
        }
Beispiel #2
0
 public TabGroupManager(TabManager tabManager, IMenuManager menuManager, IWpfFocusManager wpfFocusManager, TabGroupManagerOptions options)
 {
     this.options                   = (options ?? new TabGroupManagerOptions()).Clone();
     this.stackedContent            = new StackedContent <TabGroup>();
     this.tabSelectionChanged       = new WeakEventList <TabSelectedEventArgs>();
     this.tabGroupSelectionChanged  = new WeakEventList <TabGroupSelectedEventArgs>();
     this.tabGroupCollectionChanged = new WeakEventList <TabGroupCollectionChangedEventArgs>();
     this.tabManager                = tabManager;
     this.menuManager               = menuManager;
     this.wpfFocusManager           = wpfFocusManager;
     this._activeIndex              = -1;
 }
Beispiel #3
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));
     }
 }