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)); }
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(); }
public static void RemoveTabItem(this TabControl tabControl, TabHeader item) { tabControl.Items.Remove(item.Parent); }
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(); }
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(); }
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(); }