WPFWorkMode.xaml
24.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
<UserControl x:Class="SmartScan.SetControl.WPF.WPFWorkMode"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:SmartScan.SetControl.WPF"
mc:Ignorable="d" Loaded="UserControl_Loaded" Height="839" Width="836">
<UserControl.Resources>
<Style TargetType="RadioButton">
<Setter Property="Margin" Value="5"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style TargetType="CheckBox">
<Setter Property="Margin" Value="5"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Margin" Value="5"/>
</Style>
<Style TargetType="DataGridColumnHeader">
<Setter Property="Background" Value="#252525"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="BorderThickness" Value="0,0,1,1"/>
<Setter Property="BorderBrush" Value="#444"/>
</Style>
<!-- 自定义 RadioButton 样式 -->
<Style x:Key="LargeRadioButtonStyle" TargetType="RadioButton">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RadioButton">
<StackPanel Orientation="Horizontal">
<!-- 自定义选择框 -->
<Grid>
<Ellipse x:Name="RadioOuter"
Width="16" Height="16"
Stroke="{TemplateBinding BorderBrush}"
Fill="#252525"
StrokeThickness="1"/>
<Ellipse x:Name="RadioMark"
Width="14" Height="14"
Fill="#3399FF"
Visibility="Collapsed"/>
</Grid>
<!-- 内容 -->
<ContentPresenter Margin="8,0,0,0" VerticalAlignment="Center"
HorizontalAlignment="Left"
RecognizesAccessKey="True"/>
</StackPanel>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="true">
<Setter TargetName="RadioMark" Property="Visibility" Value="Visible"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 自定义 CheckBox 样式 -->
<Style x:Key="LargeCheckBoxStyle" TargetType="CheckBox">
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="CheckBox">
<Grid>
<!-- 自定义布局 -->
<BulletDecorator>
<!-- 调整复选框图形大小 -->
<BulletDecorator.Bullet>
<Grid Width="20" Height="20">
<!-- 未选中状态 -->
<Rectangle Stroke="Gray" Fill="#252525" x:Name="BackgroundRect"
Width="20" Height="20"
RadiusX="3" RadiusY="3"/>
<!-- 选中状态(勾号) -->
<Path x:Name="CheckMark"
Data="M5,9 L9,15 L15,3"
Stroke="#ffffff"
StrokeThickness="1.5"
Visibility="Collapsed"/>
</Grid>
</BulletDecorator.Bullet>
<!-- 文本内容 -->
<ContentPresenter Margin="10,0,0,0"
VerticalAlignment="Center"/>
</BulletDecorator>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsChecked" Value="True">
<Setter TargetName="CheckMark" Property="Visibility" Value="Visible"/>
<Setter TargetName="BackgroundRect" Property="Fill" Value="#4e77fe"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 卡片样式的边框 -->
<Style x:Key="OptionGroupBorder" TargetType="Border">
<Setter Property="Background" Value="#252525"/>
<Setter Property="BorderBrush" Value="#333333"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CornerRadius" Value="5"/>
<Setter Property="Padding" Value="15"/>
<Setter Property="Margin" Value="5"/>
</Style>
<!-- 标题样式 -->
<Style x:Key="OptionGroupTitle" TargetType="TextBlock">
<Setter Property="Foreground" Value="#3399FF"/>
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="FontSize" Value="14"/>
<Setter Property="Margin" Value="0,0,0,10"/>
<Setter Property="FontFamily" Value="微软雅黑"/>
</Style>
</UserControl.Resources>
<Grid Background="#1E1E1E">
<Grid.RowDefinitions>
<RowDefinition Height="0.6*"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<DataGrid x:Name="PrinterInfoGrid" Grid.Row="0"
AutoGenerateColumns="False"
Background="#1E1E1E" BorderThickness="1" BorderBrush="#444"
CanUserAddRows="False" CanUserDeleteRows="False"
CanUserReorderColumns="False" CanUserResizeRows="False"
CanUserSortColumns="False" IsReadOnly="True"
HeadersVisibility="Column" GridLinesVisibility="All"
RowBackground="#1E1E1E" AlternatingRowBackground="#252525"
VerticalGridLinesBrush="#444" HorizontalGridLinesBrush="#444"
SelectedCellsChanged="PrinterInfoGrid_SelectedCellsChanged">
<DataGrid.Columns>
<DataGridTextColumn x:Name="PrinterInfoGridtext" FontSize="14" FontFamily="微软雅黑" Header="打印机" Width="*" Binding="{Binding Printer}">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Background" Value="#1E1E1E"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#3399FF"/>
<Setter Property="Tag" Value="Selected"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="False"/>
<Condition Property="Tag" Value="Selected"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="#992222"/>
</MultiTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Padding" Value="14"/>
<Setter Property="FontSize" Value="14"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns>
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<!-- 设置字体大小 -->
<Setter Property="FontSize" Value="14"/>
<!-- 设置字体粗细 -->
<Setter Property="FontWeight" Value="Bold"/>
<!-- 设置前景色 -->
<Setter Property="Foreground" Value="White"/>
<!-- 设置背景色 -->
<Setter Property="Background" Value="#333333"/>
<!-- 设置内边距,使标题更大 -->
<Setter Property="Padding" Value="8"/>
<!-- 设置高度 -->
<Setter Property="Height" Value="40"/>
<!-- 设置内容对齐方式 -->
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</DataGrid.ColumnHeaderStyle>
</DataGrid>
<DataGrid x:Name="PrinterInfoGrid1" Grid.Row="0" Grid.Column="1"
AutoGenerateColumns="False"
Background="#1E1E1E" BorderThickness="1" BorderBrush="#444"
CanUserAddRows="False" CanUserDeleteRows="False"
CanUserReorderColumns="False" CanUserResizeRows="False"
CanUserSortColumns="False" IsReadOnly="True"
HeadersVisibility="Column" GridLinesVisibility="All"
RowBackground="#1E1E1E" AlternatingRowBackground="#252525"
VerticalGridLinesBrush="#444" HorizontalGridLinesBrush="#444"
SelectedCellsChanged="PrinterInfoGrid_SelectedCellsChanged">
<DataGrid.Columns>
<DataGridTextColumn x:Name="PrinterInfoGridtext1" FontSize="14" FontFamily="微软雅黑" Header="默认打印标签" Width="*" Binding="{Binding Label}">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Background" Value="#1E1E1E"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#3399FF"/>
<Setter Property="Tag" Value="Selected"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="False"/>
<Condition Property="Tag" Value="Selected"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="#992222"/>
</MultiTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Padding" Value="14"/>
<Setter Property="FontSize" Value="14"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns>
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<!-- 设置字体大小 -->
<Setter Property="FontSize" Value="14"/>
<!-- 设置字体粗细 -->
<Setter Property="FontWeight" Value="Bold"/>
<!-- 设置前景色 -->
<Setter Property="Foreground" Value="White"/>
<!-- 设置背景色 -->
<Setter Property="Background" Value="#333333"/>
<!-- 设置内边距,使标题更大 -->
<Setter Property="Padding" Value="8"/>
<!-- 设置高度 -->
<Setter Property="Height" Value="40"/>
<!-- 设置内容对齐方式 -->
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</DataGrid.ColumnHeaderStyle>
</DataGrid>
<DataGrid x:Name="PrinterInfoGrid2" Grid.Row="0" Grid.Column="2"
AutoGenerateColumns="False"
Background="#1E1E1E" BorderThickness="1" BorderBrush="#444"
CanUserAddRows="False" CanUserDeleteRows="False"
CanUserReorderColumns="False" CanUserResizeRows="False"
CanUserSortColumns="False" IsReadOnly="True"
HeadersVisibility="Column" GridLinesVisibility="All"
RowBackground="#1E1E1E" AlternatingRowBackground="#252525"
VerticalGridLinesBrush="#444" HorizontalGridLinesBrush="#444"
SelectedCellsChanged="PrinterInfoGrid_SelectedCellsChanged">
<DataGrid.Columns>
<DataGridTextColumn x:Name="PrinterInfoGridtext2" FontFamily="微软雅黑" Header="优先匹配模板" Width="*" Binding="{Binding Template}">
<DataGridTextColumn.CellStyle>
<Style TargetType="DataGridCell">
<Setter Property="Background" Value="#1E1E1E"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#3399FF"/>
<Setter Property="Tag" Value="Selected"/>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsSelected" Value="False"/>
<Condition Property="Tag" Value="Selected"/>
</MultiTrigger.Conditions>
<Setter Property="Background" Value="#992222"/>
</MultiTrigger>
</Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
<DataGridTextColumn.ElementStyle>
<Style TargetType="TextBlock">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Padding" Value="14"/>
<Setter Property="FontSize" Value="14"/>
</Style>
</DataGridTextColumn.ElementStyle>
</DataGridTextColumn>
</DataGrid.Columns>
<DataGrid.ColumnHeaderStyle>
<Style TargetType="DataGridColumnHeader">
<!-- 设置字体大小 -->
<Setter Property="FontSize" Value="14"/>
<!-- 设置字体粗细 -->
<Setter Property="FontWeight" Value="Bold"/>
<!-- 设置前景色 -->
<Setter Property="Foreground" Value="White"/>
<!-- 设置背景色 -->
<Setter Property="Background" Value="#333333"/>
<!-- 设置内边距,使标题更大 -->
<Setter Property="Padding" Value="8"/>
<!-- 设置高度 -->
<Setter Property="Height" Value="40"/>
<!-- 设置内容对齐方式 -->
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
</Style>
</DataGrid.ColumnHeaderStyle>
</DataGrid>
</Grid>
<!-- 下半部分使用网格布局 -->
<Grid Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="1*"/>
<ColumnDefinition Width="1*"/>
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<!-- 打印方式 -->
<Border Grid.Column="0" Grid.Row="0" Style="{StaticResource OptionGroupBorder}" BorderBrush="#3399FF" BorderThickness="2,0,0,0">
<StackPanel>
<TextBlock x:Name="WPF_pring" Text="打印方式" Style="{StaticResource OptionGroupTitle}"/>
<StackPanel Margin="0,5,0,0">
<RadioButton x:Name="RdoLandscape" Content="横向打印" GroupName="PrintOrientation"
Style="{StaticResource LargeRadioButtonStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" FontFamily="微软雅黑"/>
<RadioButton x:Name="RdoVertical" Content="纵向打印" GroupName="PrintOrientation"
Style="{StaticResource LargeRadioButtonStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" IsChecked="True" FontFamily="微软雅黑"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 追溯图像保存 -->
<Border Grid.Column="1" Grid.Row="0" Style="{StaticResource OptionGroupBorder}" BorderBrush="#3399FF" BorderThickness="2,0,0,0">
<StackPanel>
<TextBlock Text="追溯图像保存" x:Name="WPF_camerasave" Style="{StaticResource OptionGroupTitle}"/>
<StackPanel Margin="0,5,0,0">
<RadioButton x:Name="RdoOriginal" Content="原图" GroupName="ImageSave"
Style="{StaticResource LargeRadioButtonStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" IsChecked="True" FontFamily="微软雅黑"/>
<RadioButton x:Name="RdoCondense" Content="压缩图像" GroupName="ImageSave"
Style="{StaticResource LargeRadioButtonStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" FontFamily="微软雅黑"/>
<RadioButton x:Name="RdoNoImage" Content="不保存" GroupName="ImageSave"
Style="{StaticResource LargeRadioButtonStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" FontFamily="微软雅黑"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 打印行为 -->
<Border Grid.Column="0" Grid.Row="1" Style="{StaticResource OptionGroupBorder}" BorderBrush="#3399FF" BorderThickness="2,0,0,0">
<StackPanel>
<TextBlock Text="打印行为" Name="WPF_PringBehavior" Style="{StaticResource OptionGroupTitle}"/>
<StackPanel Margin="0,5,0,0">
<CheckBox x:Name="ChkLabelEmptyCheck" Content="打印驱动空白内容提醒"
Style="{StaticResource LargeCheckBoxStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" IsChecked="True" FontFamily="微软雅黑"/>
<CheckBox x:Name="ChkPrintCompletedClear" Content="打印驱动后清除内容"
Style="{StaticResource LargeCheckBoxStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" FontFamily="微软雅黑"/>
<CheckBox x:Name="ChkAutoPrint" Content="自动打印"
Style="{StaticResource LargeCheckBoxStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" IsChecked="True" FontFamily="微软雅黑"/>
<CheckBox x:Name="ChkAllowModifyPrint" Content="允许修改打印内容"
Style="{StaticResource LargeCheckBoxStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" FontFamily="微软雅黑"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 软件设置 -->
<Border Grid.Column="1" Grid.Row="1" Style="{StaticResource OptionGroupBorder}" BorderBrush="#3399FF" BorderThickness="2,0,0,0">
<StackPanel>
<TextBlock Text="软件设置" Name="WPF_Software" Style="{StaticResource OptionGroupTitle}"/>
<StackPanel Margin="0,5,0,0">
<CheckBox x:Name="ChkOpenEnterWork" Content="打开软件自动进入工作模式"
Style="{StaticResource LargeCheckBoxStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" IsChecked="True" FontFamily="微软雅黑"/>
<CheckBox x:Name="ChkOpenMaximize" Content="打开软件最大化窗口"
Style="{StaticResource LargeCheckBoxStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" IsChecked="True" FontFamily="微软雅黑"/>
<CheckBox x:Name="ChkPromptAfterPrinting" Content="识别完成后显示"
Style="{StaticResource LargeCheckBoxStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" FontFamily="微软雅黑"/>
<CheckBox x:Name="ChkTriggerOpenLight" Content="触发信号后自动开启光源"
Style="{StaticResource LargeCheckBoxStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" IsChecked="True" FontFamily="微软雅黑"/>
<CheckBox x:Name="ChkCheckFunction" Content="开启Check功能"
Style="{StaticResource LargeCheckBoxStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" FontFamily="微软雅黑"/>
</StackPanel>
</StackPanel>
</Border>
<!-- 数据源设置 -->
<Border Grid.Column="0" Grid.Row="2" Style="{StaticResource OptionGroupBorder}" BorderBrush="#3399FF" BorderThickness="2,0,0,0">
<StackPanel>
<TextBlock Text="数据源设置" Name="WPF_API" Style="{StaticResource OptionGroupTitle}"/>
<StackPanel Margin="0,5,0,0">
<CheckBox x:Name="ChkSelectPN" Content="从服务器查询IPN"
Style="{StaticResource LargeCheckBoxStyle}" Foreground="White"
FontSize="14" Margin="0,5,0,5" FontFamily="微软雅黑"/>
</StackPanel>
</StackPanel>
</Border>
</Grid>
</Grid>
</UserControl>