ConfirmationWindow.xaml.cs 558 B

123456789101112131415161718192021222324
  1. using System.Windows;
  2. namespace MyTests
  3. {
  4. public partial class ConfirmationWindow : Window
  5. {
  6. public bool answer;
  7. public ConfirmationWindow(bool _answer = false)
  8. {
  9. InitializeComponent();
  10. answer = _answer;
  11. }
  12. private void YesButton(object sender, RoutedEventArgs e)
  13. {
  14. answer = true;
  15. this.Close();
  16. }
  17. private void NoButton(object sender, RoutedEventArgs e)
  18. {
  19. answer = false;
  20. this.Close();
  21. }
  22. }
  23. }