NS_Keyword.xaml
15.4 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
<UserControl x:Class="SmartScan.SetControl.WPF.NS_Keyword"
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" xmlns:local1="clr-namespace:SmartScan.SetControl.WPF.Convent"
mc:Ignorable="d"
d:DesignHeight="850" d:DesignWidth="800" Loaded="UserControl_Loaded" >
<UserControl.Resources>
<Style x:Key="TextBoxStyle1" TargetType="{x:Type TextBox}">
<Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.WindowBrushKey}}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="KeyboardNavigation.TabNavigation" Value="None"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="AllowDrop" Value="true"/>
<Setter Property="ScrollViewer.PanningMode" Value="VerticalFirst"/>
<Setter Property="Stylus.IsFlicksEnabled" Value="False"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type TextBox}">
<Border CornerRadius="3" x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="True">
<ScrollViewer x:Name="PART_ContentHost" Focusable="false" HorizontalScrollBarVisibility="Hidden" VerticalScrollBarVisibility="Hidden"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsInactiveSelectionHighlightEnabled" Value="true"/>
<Condition Property="IsSelectionActive" Value="false"/>
</MultiTrigger.Conditions>
<Setter Property="SelectionBrush" Value="{DynamicResource {x:Static SystemColors.InactiveSelectionHighlightBrushKey}}"/>
</MultiTrigger>
</Style.Triggers>
</Style>
<Style x:Key="AlternatingListBoxItemStyle" TargetType="ListBoxItem">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Border Name="Bd"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}">
<ContentPresenter/>
</Border>
<ControlTemplate.Triggers>
<!-- 鼠标悬停效果 -->
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd"
Property="Background"
Value="#1AFFFFFF"/>
<!-- 10%透明度的白色 -->
</Trigger>
<!-- 选中状态触发器 -->
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#4b78d0"/>
<Setter TargetName="Bd" Property="BorderBrush" Value="#FF3C8D3C"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="VerticalContentAlignment" Value="Center"></Setter>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Foreground" Value="White"></Setter>
<Setter Property="Padding" Value="5"/>
<Setter Property="Height" Value="50"/>
<!-- 关键行高设置 -->
<Style.Triggers>
<!--<Trigger Property="ItemsControl.AlternationIndex" Value="0">
<Setter Property="Background" Value="{x:Null}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="IsSelected" Value="True"/>
</Trigger>
<Trigger Property="ItemsControl.AlternationIndex" Value="1">
<Setter Property="Background" Value="#FFB3B0B0"/>
<Setter Property="Foreground" Value="White"/>
</Trigger>-->
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" Value="#4b78d0"/>
<!-- 深翡翠绿 -->
<Setter Property="BorderBrush" Value="#FF3C8D3C"/>
</Trigger>
</Style.Triggers>
</Style>
<local1:BoolToColorConverter x:Key="BoolToColor" TrueColor="Red" FalseColor="Gray"/>
<Style x:Key="buttonStyle" TargetType="{x:Type Button}">
<Setter Property="BorderThickness" Value="0" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border CornerRadius="5" x:Name="border" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" SnapsToDevicePixels="true">
<ContentPresenter x:Name="contentPresenter" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsDefaulted" Value="true">
<Setter Property="BorderBrush" TargetName="border" Value="{DynamicResource {x:Static SystemColors.HighlightBrushKey}}" />
</Trigger>
<Trigger Property="IsMouseOver" Value="true">
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Background" TargetName="border" Value="#D2FFBB" />
<Setter Property="BorderBrush" TargetName="border" Value="#D2FFBB" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#C6FFCC"/>
<Setter Property="Foreground" Value="Black"/>
</Trigger>
</Style.Triggers>
</Style>
</UserControl.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="0.3*"></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<Rectangle Fill="#C1C1C1" Width="0.3" Grid.ColumnSpan="1" HorizontalAlignment="Right"/>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="auto"></RowDefinition>
<RowDefinition Height="1.7*"></RowDefinition>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
<Grid>
<TextBlock Text="标准字段" HorizontalAlignment="Left" Foreground="White" FontFamily="微软雅黑" VerticalAlignment="Center" Margin="20 5 0 5" FontWeight="Bold" FontSize="25"></TextBlock>
<Rectangle Fill="#C1C1C1" Height="0.3" Margin="0 5 0 0" VerticalAlignment="Bottom"/>
</Grid>
<Grid Grid.Row="1">
<ListBox ItemsSource="{Binding keyCopy}" Name="LstKey" Margin="5"
AlternationCount="2" Background="{x:Null}" BorderThickness="0"
ItemContainerStyle="{StaticResource AlternatingListBoxItemStyle}" SelectionChanged="LstKey_SelectionChanged">
<ListBox.ItemTemplate>
<DataTemplate>
<Grid HorizontalAlignment="Stretch">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="auto"/>
</Grid.ColumnDefinitions>
<TextBlock Text="{Binding}" FontSize="16" VerticalAlignment="Center" HorizontalAlignment="Left" Margin="5 0 0 0"/>
<Ellipse Grid.Column="1" Width="12" Height="12" VerticalAlignment="Center" HorizontalAlignment="Right" >
<Ellipse.Style>
<Style TargetType="Ellipse">
<Setter Property="Fill" Value="LightGray"/>
<Style.Triggers>
<DataTrigger Binding="{Binding
RelativeSource={RelativeSource
AncestorType={x:Type ListBoxItem}},
Path=IsSelected}"
Value="True">
<Setter Property="Fill" Value="Aqua"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Ellipse.Style>
</Ellipse>
</Grid>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!--<Ellipse Width="12" Height="12" Margin="0,5,0,0"
Fill="{Binding SelectedItem.a, ElementName=LstKey,
Converter={StaticResource BoolToColor}}"/>-->
</Grid>
<Grid Grid.Row="2">
</Grid>
</Grid>
<Grid Grid.Column="1">
<Grid.RowDefinitions>
<RowDefinition Height="0.1*"></RowDefinition>
<RowDefinition Height="0.2*"></RowDefinition>
<RowDefinition></RowDefinition>
<RowDefinition Height="0.3*"></RowDefinition>
</Grid.RowDefinitions>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="配置" FontSize="23" Foreground="#4975cd" FontFamily="微软雅黑" VerticalAlignment="Center" Margin="10 0 0 0" FontWeight="Bold"></TextBlock>
<Button Content="启动" Grid.Column="1" Foreground="White" Style="{DynamicResource buttonStyle}" Height="30" Margin="15,0,10,0" Width="90" FontSize="15" HorizontalAlignment="Right" VerticalAlignment="Center" Background="#4b78d0" BorderThickness="1" Name="expand" ></Button>
<TextBlock Background="#C1C1C1" Margin="0,13,0,0" Height="0.3" Grid.ColumnSpan="2" VerticalAlignment="Bottom"> </TextBlock>
</Grid>
<Grid Grid.Row="1">
<Grid.RowDefinitions>
<RowDefinition Height="0.3*"></RowDefinition>
<RowDefinition Height="0.5*"></RowDefinition>
<RowDefinition Height="0.2*"></RowDefinition>
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition ></ColumnDefinition>
<ColumnDefinition></ColumnDefinition>
</Grid.ColumnDefinitions>
<TextBlock Text="字段标识符" Foreground="#696969" FontFamily="微软雅黑" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="18"></TextBlock>
<TextBox x:Name="lst_key" Foreground="White" Background="#252525" Grid.Row="1" Style="{StaticResource TextBoxStyle1}" BorderThickness="1" CaretBrush="White" Margin="10 5 10 5" FontSize="25" FontFamily="微软雅黑" VerticalContentAlignment="Center" Text="" ></TextBox>
<TextBlock Text="API和数据库中使用的唯一标识符" FontFamily="微软雅黑" Grid.Row="2" Foreground="#707070" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="16"></TextBlock>
<TextBlock Text="显示名称:" Foreground="#696969" FontFamily="微软雅黑" VerticalAlignment="Center" Grid.Column="1" Margin="10 0 0 0" FontSize="18"></TextBlock>
<TextBox x:Name="lst_name" Foreground="White" Background="#252525" Grid.Row="1" Grid.Column="1" Style="{StaticResource TextBoxStyle1}" BorderThickness="1" CaretBrush="White" Margin="10 5 10 5" FontSize="25" VerticalContentAlignment="Center" Text="" ></TextBox>
<TextBlock Text="在界面中显示的名称" Grid.Row="2" FontFamily="微软雅黑" Grid.Column="1" Foreground="#707070" VerticalAlignment="Center" Margin="10 0 0 0" FontSize="16"></TextBlock>
</Grid>
<Grid Grid.Row="3">
<TextBlock Background="#C1C1C1" Margin="0,13,0,0" Height="0.3" Grid.ColumnSpan="2"></TextBlock>
<StackPanel Orientation="Horizontal" VerticalAlignment="Bottom" HorizontalAlignment="Right" Margin="0 0 10 10">
<Button Content="添加" Foreground="White" Style="{DynamicResource buttonStyle}" FontFamily="微软雅黑" Name="BtnAddKey" Height="30" Width="90" Margin="5" Background="#4B78D0" Click="BtnAddKey_Click"></Button>
<Button Content="删除" Foreground="White" Style="{DynamicResource buttonStyle}" FontFamily="微软雅黑" Name="BtnDelKey" Height="30" Width="90" Margin="5" Background="#4B78D0" Click="BtnDelKey_Click"></Button>
<Button Content="更新" Foreground="White" Style="{DynamicResource buttonStyle}" FontFamily="微软雅黑" Name="BtnUpdateKey" Height="30" Width="90" Margin="5" Background="#4B78D0" Click="BtnUpdateKey_Click"></Button>
<Button Content="添加到生成条件" Style="{DynamicResource buttonStyle}" FontFamily="微软雅黑" Foreground="White" Name="BtnAppendKey" Width="90" Height="30" Margin="5" Background="#4B78D0"></Button>
<Button Content="切换自动RI" Style="{DynamicResource buttonStyle}" FontFamily="微软雅黑" Foreground="White" Name="btn_setriid" Width="90" Height="30" Margin="5" Background="#4B78D0"></Button>
</StackPanel>
</Grid>
</Grid>
</Grid>
</UserControl>