Esempio n. 1
0
		public ITabGroupService Create(TabGroupServiceOptions options = null) {
			var mgr = new TabGroupService(this, menuService, wpfFocusService, options);
			tabGroupServices.Add(mgr);
			if (selectedIndex < 0)
				selectedIndex = 0;
			return mgr;
		}
Esempio n. 2
0
        internal void SetActive(TabGroupService tabGroupService)
        {
            int index = tabGroupServices.IndexOf(tabGroupService);

            Debug.Assert(index >= 0);
            if (index >= 0)
            {
                selectedIndex = index;
            }
        }
Esempio n. 3
0
        public ITabGroupService Create(TabGroupServiceOptions options = null)
        {
            var mgr = new TabGroupService(this, menuService, wpfFocusService, options);

            tabGroupServices.Add(mgr);
            if (selectedIndex < 0)
            {
                selectedIndex = 0;
            }
            return(mgr);
        }
Esempio n. 4
0
 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));
     }
 }
Esempio n. 5
0
		internal void SetActive(TabGroupService tabGroupService) {
			int index = tabGroupServices.IndexOf(tabGroupService);
			Debug.Assert(index >= 0);
			if (index >= 0)
				selectedIndex = index;
		}
Esempio n. 6
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));
		}