ConfirmationWindow.xaml.cs 769 B

123456789101112131415161718192021222324252627282930
  1. using System.Windows;
  2. using System.Windows.Input;
  3. namespace MyTests
  4. {
  5. public partial class ConfirmationWindow : Window
  6. {
  7. public bool answer;
  8. public ConfirmationWindow(bool _answer = false)
  9. {
  10. InitializeComponent();
  11. answer = _answer;
  12. }
  13. private void YesButton(object sender, RoutedEventArgs e)
  14. {
  15. answer = true;
  16. this.Close();
  17. }
  18. private void NoButton(object sender, RoutedEventArgs e)
  19. {
  20. answer = false;
  21. this.Close();
  22. }
  23. private void Border_MouseDown(object sender, MouseButtonEventArgs e)
  24. {
  25. if (e.LeftButton == MouseButtonState.Pressed)
  26. DragMove();
  27. }
  28. }
  29. }