public void AddContentsTab()
        {
            //using ItemsSource, modify collection to contain TOC Tab
            IList items = _tabControl.ItemsSource as IList;

            if (items != null)
            {
                _tabControl.ItemsSource = null;
                items.Insert(0, _tabControl.GetContentsTab());
                _tabControl.ItemsSource = items;
                (_tabControl.ItemContainerGenerator.ContainerFromItem(items[1]) as TabItem).Focus();
            }
        }
Exemple #2
0
 public void AddContentsTab()
 {
     //presumably using items collection, modify that collection to contain TOC Tab
     _tabControl.Items.Insert(0, _tabControl.GetContentsTab());
 }