private void TCSelectionchanged(object sender, SelectionChangedEventArgs e) { TabControl tc = sender as TabControl; if (tc != null) { if (tc.SelectedItem == Tabcreate) { if (currenttab == "Update") { UCC = new UCCreate(EmployeePositions); } UCCreateContent.Content = UCC; DataGridEmployees.UnselectAll(); TabController.SelectedIndex = 0; TabUpdate.Header = "View Employee"; currenttab = "Create"; } if (tc.SelectedItem == TabUpdate) { if (DataGridEmployees.SelectedItem != null) { UCUpdateContent.Content = UCU = new UCUpdate(SelectedEmployee, TabUpdate, EmployeePositions); TabUpdate.Header = "View Employee"; TabController.SelectedIndex = 1; currenttab = "Update"; } } } }
//private void btnEdit_Click(object sender, RoutedEventArgs e) //{ // EditMode = true; // TabUpdate.Header = "Update Employee"; // UCUpdateContent.Content = UCU = new UCUpdate(SelectedEmployee, TabUpdate); //} private void BtnForceRefresh_Click(object sender, RoutedEventArgs e) { DataGridEmployees.UnselectAll(); TabController.SelectedIndex = 0; TabUpdate.Header = "View Employee"; ForceRefresh(); }