ConfirmationWindow.xaml.cs 821 B

12345678910111213141516171819202122232425262728293031
  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. Owner = Application.Current.MainWindow;
  12. answer = _answer;
  13. }
  14. private void YesButton(object sender, RoutedEventArgs e)
  15. {
  16. answer = true;
  17. this.Close();
  18. }
  19. private void NoButton(object sender, RoutedEventArgs e)
  20. {
  21. answer = false;
  22. this.Close();
  23. }
  24. private void Border_MouseDown(object sender, MouseButtonEventArgs e)
  25. {
  26. if (e.LeftButton == MouseButtonState.Pressed)
  27. DragMove();
  28. }
  29. }
  30. }