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
{
///
/// MainWindow.xaml 的交互逻辑
///
public partial class MainWindow : Window
{
///
/// 屏幕宽
///
internal double pwidth = SystemParameters.PrimaryScreenWidth;
///
/// 屏幕高
///
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;
}
}
}
}