public void AddFromCategoryScheme() { if (SelectedCodeScheme == null) { return; } SelectCategorySchemeWindow dlg = new SelectCategorySchemeWindow(StudyUnit); dlg.Owner = Application.Current.MainWindow; dlg.ShowDialog(); if (dlg.DialogResult != true) { return; } AddCodes(dlg.SelectedCategories); }