private void usl_Click(object sender, RoutedEventArgs e) { Window6 winTool = new Window6(); //Назначение текущего окна владельцем. winTool.Owner = this; //Отображение окна, принадлежащего окну-владельцу. winTool.Show(); this.Hide(); }
private void button_Click(object sender, RoutedEventArgs e) { bool genderPicked = true; bool birthdayPicked = true; if ((bool)maleRadioButton.IsChecked) { Data.newUserGender = "male"; } else if ((bool)femaleRadioButton1.IsChecked) { Data.newUserGender = "female"; } else { genderPicked = false; } if (birthDatePicker.SelectedDate != null) { Data.newUserBirthday = (DateTime)birthDatePicker.SelectedDate; } else { birthdayPicked = false; } if (genderPicked && birthdayPicked) { Window6 w = new Window6(); w.Show(); this.Close(); } else { MessageBox.Show("Please choose!"); } }