zhangxueyang pirms 3 gadiem
vecāks
revīzija
5030b3b048

+ 3
- 2
XHPZ.Desktop/APP.cs Parādīt failu

@@ -58,6 +58,7 @@ namespace XHPZ.Desktop
58 58
         public static bool TQLPenStatus = false;
59 59
         #endregion
60 60
         #region 页面
61
+        public static MainWindow W_mainWindow = null;
61 62
         ///// <summary>
62 63
         ///// 批注
63 64
         ///// </summary>
@@ -124,10 +125,10 @@ namespace XHPZ.Desktop
124 125
                 if (principal.IsInRole(WindowsBuiltInRole.Administrator))
125 126
                 {
126 127
                     //如果是管理员,则直接运行
127
-                    MainWindow mainWindow = new MainWindow();
128
+                    W_mainWindow = new MainWindow();
128 129
                     // 定义Application对象作为整个应用程序入口
129 130
                     Application app = new Application();
130
-                    app.Run(mainWindow);
131
+                    app.Run(W_mainWindow);
131 132
                 }
132 133
                 else
133 134
                 {

+ 3
- 6
XHPZ.Desktop/MainWindow.xaml Parādīt failu

@@ -5,17 +5,14 @@
5 5
         xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6 6
         xmlns:local="clr-namespace:XHPZ.Desktop"
7 7
         mc:Ignorable="d"
8
-<<<<<<< HEAD
9
-        Title="智慧批注" Height="300" Width="300">
10
-=======
11
-        Title="MainWindow" 
8
+        Title="智慧批注" 
9
+
12 10
     WindowStyle="None" AllowsTransparency="True"    WindowState="Normal"
13
-    ShowInTaskbar="False"  Topmost="True" ResizeMode="NoResize" 
11
+    ShowInTaskbar="True"  Topmost="True" ResizeMode="NoResize" 
14 12
         d:DesignHeight="250" Width="500" Height="250"  MouseMove="Window_MouseMove"  BorderThickness="7">
15 13
     <Window.Effect>
16 14
         <DropShadowEffect BlurRadius="10" Color="#bababa" Direction="80" ShadowDepth="0"/>
17 15
     </Window.Effect>
18
->>>>>>> c3ffa44dd9c0e70fe134cf74c328dc36897b6b64
19 16
     <Grid>
20 17
         <TextBlock Text="欢迎使用星火批注!" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" Margin="0,0,0,35"/>
21 18
         <TextBlock Text="使用点阵笔时自动批注,右键退出批注。" VerticalAlignment="Center" HorizontalAlignment="Center" FontSize="20" Margin="0,35,0,0"/>

+ 18
- 6
XHPZ.Desktop/MainWindow.xaml.cs Parādīt failu

@@ -36,7 +36,7 @@ namespace XHPZ.Desktop
36 36
 
37 37
 
38 38
 
39
-           if(APP.W_PracticeWindow==null)
39
+            if (APP.W_PracticeWindow == null)
40 40
             {
41 41
                 APP.W_PracticeWindow = new PracticeWindow
42 42
                 {
@@ -68,7 +68,23 @@ namespace XHPZ.Desktop
68 68
                 System.Environment.Exit(0);
69 69
             }
70 70
         }
71
-
71
+        public void UpdateDevStatus()
72
+        {
73
+            if (APP.PenStatus || APP.TQLPenStatus)
74
+            {
75
+                Dispatcher.Invoke(new Action(() =>
76
+                {
77
+                    txbType.Text = "已连接";
78
+                }));
79
+            }
80
+            else
81
+            {
82
+                Dispatcher.Invoke(new Action(() =>
83
+                {
84
+                    txbType.Text = "未连接";
85
+                }));
86
+            }
87
+        }
72 88
         private void BtnMin_Click(object sender, RoutedEventArgs e)
73 89
         {
74 90
             if (WindowState == WindowState.Minimized)
@@ -81,8 +97,4 @@ namespace XHPZ.Desktop
81 97
             }
82 98
         }
83 99
     }
84
-
85
-
86
-
87
-
88 100
 }

+ 2
- 1
XHPZ.Desktop/PracticeWindow.xaml.cs Parādīt failu

@@ -136,7 +136,7 @@ namespace XHPZ.Desktop
136 136
 
137 137
                 //开始接收笔数据
138 138
                 APP.digitalPen.GetPenData(penSerial);
139
-                //UpdateDevStatus();
139
+                APP.W_mainWindow.UpdateDevStatus();
140 140
                 ////Dispatcher.Invoke(new Action(() =>
141 141
                 ////{
142 142
                 ////    txbNotConnected.Text = "已连接";
@@ -162,6 +162,7 @@ namespace XHPZ.Desktop
162 162
             {
163 163
                 APP.PenSerial = penSerial;
164 164
                 APP.PenStatus = false;
165
+                APP.W_mainWindow.UpdateDevStatus();
165 166
                 //UpdateDevStatus();
166 167
                 ////Dispatcher.Invoke(new Action(() =>
167 168
                 ////{

+ 2
- 2
XHPZ.Desktop/TQLPen/PenEvents.cs Parādīt failu

@@ -82,14 +82,14 @@ namespace XHPZ.Desktop
82 82
                 {
83 83
                     APP.TQLPenStatus = true;
84 84
                     //form.AddLog("智能笔已连接!");
85
-                    //APP.W_XHMicroLessonSystemWindow.UpdateDevStatus();
85
+                    APP.W_mainWindow.UpdateDevStatus();
86 86
                 }
87 87
                 else
88 88
                 {
89 89
                     APP.TQLPenStatus = false;
90 90
                     //form.DisConnect();
91 91
                     //form.AddLog("智能笔已断开连接!");
92
-                    //APP.W_XHMicroLessonSystemWindow.UpdateDevStatus();
92
+                    APP.W_mainWindow.UpdateDevStatus();
93 93
                 }
94 94
             }
95 95
             catch (Exception)

Notiek ielāde…
Atcelt
Saglabāt