예제 #1
0
        /// <summary>Calls <see cref="CreateTab" />, adds the resulting tab to the <see cref="Tabs" /> collection, and activates it.</summary>
        public virtual void AddNewTab()
        {
            TitleBarTab newTab = null;

            if (AutoCreateTab)
            {
                newTab = CreateTab();
                Tabs.Add(newTab);
                ResizeTabContents(newTab);
                SelectedTabIndex = _tabs.Count - 1;
            }

            var titleBarTabEventArgs = new TitleBarTabEventArgs
            {
                Tab         = newTab,
                TabIndex    = SelectedTabIndex,
                Action      = TabControlAction.Selected,
                WasDragging = false
            };

            TabCreated?.Invoke(this, titleBarTabEventArgs);
        }
예제 #2
0
 public void Apply(TabCreated tabCreated)
 {
     Id = tabCreated.TabId;
 }
 public void CreateTab(string tabName, object parameter)
 => TabCreated?.Invoke(tabName, new TabNavigationEventArgs(parameter));