Exemple #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;
		}
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));
		}
Exemple #3
0
		public TabGroupService(TabService tabService, IMenuService menuService, IWpfFocusService wpfFocusService, TabGroupServiceOptions options) {
			this.options = (options ?? new TabGroupServiceOptions()).Clone();
			stackedContent = new StackedContent<TabGroup>();
			tabSelectionChanged = new WeakEventList<TabSelectedEventArgs>();
			tabGroupSelectionChanged = new WeakEventList<TabGroupSelectedEventArgs>();
			tabGroupCollectionChanged = new WeakEventList<TabGroupCollectionChangedEventArgs>();
			this.tabService = tabService;
			this.menuService = menuService;
			this.wpfFocusService = wpfFocusService;
			_activeIndex = -1;
		}