private void Button_Click(object sender, RoutedEventArgs e) { Window3 windo3 = new Window3(); if (truac == false) { acc = false; windo3.Show(); rest(windo3); } else { const string message = "Вы хотите прекратить наблюдения?"; const string caption = "Закрыть?"; var result = MessageBox.Show(message, caption, MessageBoxButton.YesNo); // If the no button was pressed ... if (result == MessageBoxResult.Yes) { // cancel the closure of the form. truac = false; bb.Content = "Создать"; ab.Content = "Войти"; win3.Title = "Бассейн"; } } }
private void Button_Click_1(object sender, RoutedEventArgs e)//обработка одноой из кнопок { Window3 windo3 = new Window3(); if (truac == false) { acc = true; windo3.Show(); rest(windo3); } else { MainWindow mm = new MainWindow(); pr = true; mm.Show(); rest1(mm); } }