123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Data;
- using System.Windows.Documents;
- using System.Windows.Input;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- using System.Windows.Navigation;
- using System.Windows.Shapes;
- using Common.system;
-
- namespace XHPZ.Desktop
- {
- /// <summary>
- /// MainWindow.xaml 的交互逻辑
- /// </summary>
- public partial class MainWindow : Window
- {
- /// <summary>
- /// 屏幕宽
- /// </summary>
- internal double pwidth = SystemParameters.PrimaryScreenWidth;
- /// <summary>
- /// 屏幕高
- /// </summary>
- internal double pHeight = SystemParameters.PrimaryScreenHeight;
- public MainWindow()
- {
- InitializeComponent();
- LogHelper.WriteInfoLog("启动");
-
-
-
- if (APP.W_PracticeWindow == null)
- {
- APP.W_PracticeWindow = new PracticeWindow
- {
- Width = pwidth,
- Height = pHeight,
- Left = 0,
- Top = 0
- };
- }
- APP.W_PracticeWindow.Topmost = true;
- APP.W_PracticeWindow.Initialize();
- APP.W_PracticeWindow.Show();
- }
-
- private void Window_MouseMove(object sender, MouseEventArgs e)
- {
- if (e.LeftButton == MouseButtonState.Pressed)
- {
- //this.DragMove();
- DragMove();
- }
- }
-
- private void BtnClose_Click(object sender, RoutedEventArgs e)
- {
- MessageBoxResult br = MessageWindow.Show("确定退出系统?", "退出", MessageBoxButton.OKCancel);
- if (br == MessageBoxResult.OK)
- {
- System.Environment.Exit(0);
- }
- }
- public void UpdateDevStatus()
- {
- if (APP.PenStatus || APP.TQLPenStatus)
- {
- Dispatcher.Invoke(new Action(() =>
- {
- txbType.Text = "已连接";
- }));
- }
- else
- {
- Dispatcher.Invoke(new Action(() =>
- {
- txbType.Text = "未连接";
- }));
- }
- }
- private void BtnMin_Click(object sender, RoutedEventArgs e)
- {
- if (WindowState == WindowState.Minimized)
- {
- WindowState = WindowState.Normal;
- }
- else
- {
- WindowState = WindowState.Minimized;
- }
- }
- }
- }
|