private void regizanClick(object sender, RoutedEventArgs e) { TaskWindow reg = new TaskWindow(); reg.Show(); reg.Owner = this;//теперь окно taskwindow принадлежит mainwindow }
private void Button_Click_1(object sender, RoutedEventArgs e) { TaskWindow taskWindow = new TaskWindow(); taskWindow.Show(); }