/** * Render people tab dynamically (add it to the TabControl) */ public void LoadPeopleTab() { TabPage peopleTabPage = new TabPage("People"); PeopleTab peopleTab = new PeopleTab(); peopleTab.DataSetId = Constants.PEOPLE_DATASET_ID; peopleTab.PagedDataProvider = _presenter; peopleTab.PageSize = 10; peopleTab.SelectPage(1); peopleTabPage.Controls.Add(peopleTab); tabOrganization.TabPages.Add(peopleTabPage); }
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(); }