Пример #1
0
        private void TxtContent_TextChanged(object sender, System.Windows.Controls.TextChangedEventArgs e)
        {
            if (LockTabCreation)
            {
                return;
            }

            var tab = tabControl1.SelectedValue as MyTab;

            if (tab == null)
            {
                if (TabManager.Tabs.Count == 0)
                {
                    TabManager.AddNewTab();

                    tab         = TabManager.Tabs.Last();
                    tab.Content = txtContent.Text;
                    JumpToLastTab();
                }
                else
                {
                    tab         = TabManager.Tabs.First();
                    tab.Content = txtContent.Text;
                    tabControl1.SelectedIndex = 0;
                }
            }

            tab.Content = txtContent.Text;
        }
Пример #2
0
 private void AddNewTab()
 {
     TabManager.AddNewTab();
     JumpToLastTab();
 }