星火批注
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

3 年前
3 年前
3 年前
3 年前
3 年前
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100
  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.Navigation;
  14. using System.Windows.Shapes;
  15. using Common.system;
  16. namespace XHPZ.Desktop
  17. {
  18. /// <summary>
  19. /// MainWindow.xaml 的交互逻辑
  20. /// </summary>
  21. public partial class MainWindow : Window
  22. {
  23. /// <summary>
  24. /// 屏幕宽
  25. /// </summary>
  26. internal double pwidth = SystemParameters.PrimaryScreenWidth;
  27. /// <summary>
  28. /// 屏幕高
  29. /// </summary>
  30. internal double pHeight = SystemParameters.PrimaryScreenHeight;
  31. public MainWindow()
  32. {
  33. InitializeComponent();
  34. LogHelper.WriteInfoLog("启动");
  35. if (APP.W_PracticeWindow == null)
  36. {
  37. APP.W_PracticeWindow = new PracticeWindow
  38. {
  39. Width = pwidth,
  40. Height = pHeight,
  41. Left = 0,
  42. Top = 0
  43. };
  44. }
  45. APP.W_PracticeWindow.Topmost = true;
  46. APP.W_PracticeWindow.Initialize();
  47. APP.W_PracticeWindow.Show();
  48. }
  49. private void Window_MouseMove(object sender, MouseEventArgs e)
  50. {
  51. if (e.LeftButton == MouseButtonState.Pressed)
  52. {
  53. //this.DragMove();
  54. DragMove();
  55. }
  56. }
  57. private void BtnClose_Click(object sender, RoutedEventArgs e)
  58. {
  59. MessageBoxResult br = MessageWindow.Show("确定退出系统?", "退出", MessageBoxButton.OKCancel);
  60. if (br == MessageBoxResult.OK)
  61. {
  62. System.Environment.Exit(0);
  63. }
  64. }
  65. public void UpdateDevStatus()
  66. {
  67. if (APP.PenStatus || APP.TQLPenStatus)
  68. {
  69. Dispatcher.Invoke(new Action(() =>
  70. {
  71. txbType.Text = "已连接";
  72. }));
  73. }
  74. else
  75. {
  76. Dispatcher.Invoke(new Action(() =>
  77. {
  78. txbType.Text = "未连接";
  79. }));
  80. }
  81. }
  82. private void BtnMin_Click(object sender, RoutedEventArgs e)
  83. {
  84. if (WindowState == WindowState.Minimized)
  85. {
  86. WindowState = WindowState.Normal;
  87. }
  88. else
  89. {
  90. WindowState = WindowState.Minimized;
  91. }
  92. }
  93. }
  94. }