PickPatientReminderTableDialog dialog = new PickPatientReminderTableDialog(); dialog.Owner = Application.Current.Windows.Cast<Window>().SingleOrDefault(x => x.IsActive);