MessageWindow.xaml.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using System.Windows.Controls;
  8. using System.Windows.Data;
  9. using System.Windows.Documents;
  10. using System.Windows.Input;
  11. using System.Windows.Media;
  12. using System.Windows.Media.Imaging;
  13. using System.Windows.Shapes;
  14. namespace ivf_tl_Operate.Windows
  15. {
  16. /// <summary>
  17. /// MessageWindow.xaml 的交互逻辑
  18. /// </summary>
  19. public partial class MessageWindow : Window
  20. {
  21. public MessageWindow(string message, bool isXiaoChuangKou = false)
  22. {
  23. InitializeComponent();
  24. _textBlock.Text = message;
  25. if (isXiaoChuangKou) return;
  26. Loaded += (s, e) =>
  27. {
  28. AppData.Instance.MainWindow.Mark(true);
  29. };
  30. Closing += (s, e) =>
  31. {
  32. AppData.Instance.MainWindow.Mark(false);
  33. };
  34. }
  35. public MessageWindow(Window w,string message, string tilele, bool isXiaoChuangKou = false)
  36. {
  37. InitializeComponent();
  38. this.Owner = w;
  39. _textBlock.Text = message;
  40. this._tile_TextBlock.Text = tilele;
  41. if (isXiaoChuangKou) return;
  42. Loaded += (s, e) =>
  43. {
  44. AppData.Instance.MainWindow.Mark(true);
  45. };
  46. Closing += (s, e) =>
  47. {
  48. AppData.Instance.MainWindow.Mark(false);
  49. };
  50. }
  51. private void Sure_Click(object sender, RoutedEventArgs e)
  52. {
  53. this.DialogResult = true;
  54. }
  55. private void Cancel_Click(object sender, RoutedEventArgs e)
  56. {
  57. this.DialogResult = false;
  58. }
  59. }
  60. }