Example #1
0
        public void AddTabTest()
        {
            var tabControl = new TabControl();
            var tab = new TabItem();
            var tabHeader = new TabHeader();
            tab.Header = tabHeader;

            AddTab(tabControl, tab);

            Assert.IsTrue(tabControl.Items.Contains(tab));
        }
Example #2
0
 private void CompaniesButtonClick(object sender, RoutedEventArgs e)
 {
     var header = new TabHeader();
     header.HeaderText = "Companies";
     header.Closing += OnTabCloseRequest;
     var tab = new TabItem()
     {
         Header = header,
     };
     var companies = Database.DatabaseAccess.GetEntitiesOfType<Company>().ToList();
     var companiesTab = new CompaniesTab() { Companies = companies };
     tab.Content = companiesTab;
     tab.InvalidateArrange();
     tabViewer.Items.Add(tab);
     tabViewer.SelectedItem = tab;
     UpdateLayout();
 }
Example #3
0
 public static void RemoveTabItem(this TabControl tabControl, TabHeader item)
 {
     tabControl.Items.Remove(item.Parent);
 }
Example #4
0
 private void CalendarButtonClick(object sender, RoutedEventArgs e)
 {
     var header = new TabHeader();
     header.HeaderText = "Calendar";
     header.Closing += OnTabCloseRequest;
     var tab = new TabItem()
     {
         Header = header,
     };
     var calendarTab = new CalendarTab();
     tab.Content = calendarTab;
     tab.InvalidateArrange();
     tabViewer.Items.Add(tab);
     tabViewer.SelectedItem = tab;
     UpdateLayout();
 }
Example #5
0
 private void ProjectsButtonClick(object sender, RoutedEventArgs e)
 {
     var header = new TabHeader();
     header.HeaderText = "Projects";
     header.Closing += OnTabCloseRequest;
     var tab = new TabItem()
     {
         Header = header,
     };
     var projectsTab = new ProjectsTab();
     tab.Content = projectsTab;
     projectsTab.ProjectsToDisplay = DatabaseAccess.GetEntitiesOfType<Project>() as List<Project>;
     tab.InvalidateArrange();
     tabViewer.Items.Add(tab);
     tabViewer.SelectedItem = tab;
     UpdateLayout();
 }
Example #6
0
 private void PeopleButtonClick(object sender, RoutedEventArgs e)
 {
     var header = new TabHeader();
     header.HeaderText = "People";
     header.Closing += OnTabCloseRequest;
     var tab = new TabItem()
     {
         Header = header,
     };
     var peopleTab = new PeopleTab();
     peopleTab.People = DatabaseAccess.GetEntitiesOfType<Person>() as IList<Person>;
     tab.Content = peopleTab;
     tab.InvalidateArrange();
     tabViewer.Items.Add(tab);
     tabViewer.SelectedItem = tab;
     UpdateLayout();
 }