private void BtnEditDepartment_Clicks(object sender, RoutedEventArgs e) { this.isEdit = true; NewDepartment v = new NewDepartment(this); v.Show(); }
private void BtnNewDepartment_Clicks(object sender, RoutedEventArgs e) { this.isEdit = false; bool isWindowOpen = false; foreach (Window w in Application.Current.Windows) { if (w is NewDepartment) { isWindowOpen = true; w.Activate(); } } if (!isWindowOpen) { NewDepartment period = new NewDepartment(this); period.Show(); } }