forked from NewLifeX/XCoder
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMainWindow.xaml
305 lines (278 loc) · 19.2 KB
/
MainWindow.xaml
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
<Window x:Class="CrazyCoder.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:CrazyCoder"
mc:Ignorable="d"
Title="新生命码神工具" Width="1000" Height="600" WindowStyle="None" AllowsTransparency="True" ResizeMode="CanResizeWithGrip" WindowStartupLocation="CenterScreen">
<Window.Resources>
<Style x:Key="RadioButtonStyle" TargetType="{x:Type RadioButton}">
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="2" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Margin" Value="0 2 0 0"/>
<Setter Property="FontSize" Value="26"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="HorizontalContentAlignment" Value="Left"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="Foreground" Value="Black"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type RadioButton}">
<Grid x:Name="templateRoot" Background="Transparent" SnapsToDevicePixels="True">
<Border x:Name="border" BorderBrush="Red" BorderThickness="0" SnapsToDevicePixels="True"/>
<Border x:Name="bd2"/>
<ContentPresenter x:Name="contentPresenter" ContentTemplate="{TemplateBinding ContentTemplate}"
Content="{TemplateBinding Content}" Grid.Column="1"
ContentStringFormat="{TemplateBinding ContentStringFormat}" Focusable="False"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="HasContent" Value="True">
<Setter Property="FocusVisualStyle">
<Setter.Value>
<Style>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle Margin="14,0,0,0" SnapsToDevicePixels="True" Stroke="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}" StrokeThickness="1" StrokeDashArray="1 2"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Padding" Value="4,-1,0,0"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#F7F7F7" TargetName="border"/>
</Trigger>
<Trigger Property="IsChecked" Value="true">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="{Binding BackColor}"/>
<Setter Property="BorderThickness" Value="4 0 0 0" TargetName="bd2"/>
<Setter Property="BorderBrush" Value="{Binding BackColor}" TargetName="bd2"/>
<Setter Property="Background" Value="{Binding BackColor}" TargetName="border"/>
<Setter Property="Opacity" Value="0.05" TargetName="border"/>
</Trigger>
<Trigger Property="IsChecked" Value="{x:Null}"/>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="MinHeight" Value="44"/>
<Setter Property="HorizontalAlignment" Value="Stretch"/>
</Style>
</Window.Resources>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="280"/>
<ColumnDefinition/>
</Grid.ColumnDefinitions>
<!--<Border Grid.Column="0" Panel.ZIndex="1" Background="#FFFFFF">
<Border.Effect>
<DropShadowEffect Color="#D1D1D1" BlurRadius="30" ShadowDepth="10" Opacity="1" />
</Border.Effect>
</Border>-->
<Grid Panel.ZIndex="1">
<Grid.Background>
<ImageBrush ImageSource="./Images/leaf.png" Stretch="Uniform" Opacity="0.12" />
</Grid.Background>
<Grid.RowDefinitions>
<RowDefinition Height="90"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border Margin="30 0 30 0" BorderBrush="#E3E4E8" BorderThickness="0 0 0 1"/>
<TextBlock Text="新生命码神工具" FontWeight="Light" FontSize="22" HorizontalAlignment="Center" VerticalAlignment="Center" MouseDown="Nav_MouseDown"/>
<StackPanel Grid.Row="1">
<ListBox ItemsSource="{Binding Menus}" SelectedItem="{Binding SelectedMenu}" BorderThickness="0">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Grid>
<Border Name="border"/>
<ContentPresenter/>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Background" TargetName="border" Value="Transparent"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<RadioButton Command="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type local:MainWindow}},
Path=DataContext.SelectedCommand,Mode=TwoWay}" Style="{DynamicResource RadioButtonStyle}"
CommandParameter="{Binding}">
<RadioButton.IsChecked>
<Binding Path="IsSelected" RelativeSource="{RelativeSource AncestorType=ListBoxItem}" Mode="TwoWay"/>
</RadioButton.IsChecked>
<StackPanel Orientation="Horizontal">
<TextBlock Grid.Column="0" Text="{Binding IconFont}" FontFamily="./Fonts/#iconfont" FontSize="22"
Margin="10 0 0 0" Foreground="Red"/>
<TextBlock Margin="10 0 0 0" Text="{Binding Title}" FontSize="14" VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1,
AncestorType={x:Type RadioButton}}}" />
</StackPanel>
</RadioButton>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
<!--<RadioButton Style="{DynamicResource RadioButtonStyle}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="" FontFamily="./Fonts/#iconfont" FontSize="22" Margin="10 0 0 0" Foreground="Green"/>
<TextBlock Margin="10 0 0 0" Text="数据建模" FontSize="14" VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type RadioButton}}}" />
</StackPanel>
</RadioButton>
<Border BorderThickness="0 1 0 0" Margin="10" BorderBrush="#EAEAEA" />
<RadioButton Style="{DynamicResource RadioButtonStyle}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="" FontFamily="./Fonts/#iconfont" FontSize="22" Margin="10 0 0 0" Foreground="Green"/>
<TextBlock Margin="10 0 0 0" Text="正则表达式" FontSize="14" VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type RadioButton}}}" />
</StackPanel>
</RadioButton>
<RadioButton Style="{DynamicResource RadioButtonStyle}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="" FontFamily="./Fonts/#iconfont" FontSize="22" Margin="10 0 0 0" Foreground="#CD3700"/>
<TextBlock Margin="10 0 0 0" Text="图标水印" FontSize="14" VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type RadioButton}}}" />
</StackPanel>
</RadioButton>
<RadioButton Style="{DynamicResource RadioButtonStyle}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="" FontFamily="./Fonts/#iconfont" FontSize="22" Margin="10 0 0 0" Foreground="Green"/>
<TextBlock Margin="10 0 0 0" Text="加密解密" FontSize="14" VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type RadioButton}}}" />
</StackPanel>
</RadioButton>
<RadioButton Style="{DynamicResource RadioButtonStyle}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="" FontFamily="./Fonts/#iconfont" FontSize="22" Margin="10 0 0 0" Foreground="#CD3700"/>
<TextBlock Margin="10 0 0 0" Text="语音助手" FontSize="14" VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type RadioButton}}}" />
</StackPanel>
</RadioButton>
<RadioButton Style="{DynamicResource RadioButtonStyle}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="" FontFamily="./Fonts/#iconfont" FontSize="22" Margin="10 0 0 0" Foreground="Green" />
<TextBlock Margin="10 0 0 0" Text="文件夹统计" FontSize="14" VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type RadioButton}}}" />
</StackPanel>
</RadioButton>
<RadioButton Style="{DynamicResource RadioButtonStyle}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="" FontFamily="./Fonts/#iconfont" FontSize="22" Margin="10 0 0 0" Foreground="#6074C2" />
<TextBlock Margin="10 0 0 0" Text="文件编码" FontSize="14" VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type RadioButton}}}" />
</StackPanel>
</RadioButton>
<Border BorderThickness="0 1 0 0" Margin="10" BorderBrush="#EAEAEA" />
<RadioButton Style="{DynamicResource RadioButtonStyle}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="" FontFamily="./Fonts/#iconfont" FontSize="22" Margin="10 0 0 0" Foreground="#6074C2" />
<TextBlock Margin="10 0 0 0" Text="网络工具" FontSize="14" VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type RadioButton}}}" />
</StackPanel>
</RadioButton>
<RadioButton Style="{DynamicResource RadioButtonStyle}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="" FontFamily="./Fonts/#iconfont" FontSize="22" Margin="10 0 0 0" Foreground="#6074C2" />
<TextBlock Margin="10 0 0 0" Text="RPC工具" FontSize="14" VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type RadioButton}}}" />
</StackPanel>
</RadioButton>
<RadioButton Style="{DynamicResource RadioButtonStyle}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="" FontFamily="./Fonts/#iconfont" FontSize="22" Margin="10 0 0 0" Foreground="#6074C2" />
<TextBlock Margin="10 0 0 0" Text="串口工具" FontSize="14" VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type RadioButton}}}" />
</StackPanel>
</RadioButton>
<RadioButton Style="{DynamicResource RadioButtonStyle}" >
<StackPanel Orientation="Horizontal">
<TextBlock Text="" FontFamily="./Fonts/#iconfont" FontSize="22" Margin="10 0 0 0" Foreground="#6074C2" />
<TextBlock Margin="10 0 0 0" Text="地图接口" FontSize="14" VerticalAlignment="Center"
Foreground="{Binding Foreground, RelativeSource={RelativeSource FindAncestor, AncestorLevel=1, AncestorType={x:Type RadioButton}}}" />
</StackPanel>
</RadioButton>-->
</StackPanel>
</Grid>
<Grid Grid.Column="1" Background="{Binding SelectedMenu.BackColor}">
<Grid.RowDefinitions>
<RowDefinition Height="30"/>
<RowDefinition/>
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal" HorizontalAlignment="Right" MouseDown="Nav_MouseDown">
<Button Name="btnMin" Width="45" Height="30" Content="─" Foreground="White" BorderThickness="0" Background="Transparent" Click="Min_Click" />
<Button Name="btnMax" Width="45" Height="30" Content="☐" Foreground="White" BorderThickness="0" Background="Transparent" Click="Max_Click" />
<Button Name="btnClose" Width="45" Height="30" Content="✕" Foreground="White" BorderThickness="0" Background="Transparent" Click="Close_Click" />
</StackPanel>
<StackPanel Grid.Row="1" Grid.ColumnSpan="2">
<StackPanel HorizontalAlignment="Left" Margin="30 0 0 0">
<StackPanel Orientation="Horizontal">
<TextBlock Name="ico" Text="{Binding SelectedMenu.IconFont}"
FontFamily="./Fonts/#iconfont" VerticalAlignment="Center"
Foreground="White" FontSize="40"/>
<TextBlock Name="tit" Text="{Binding SelectedMenu.Title}" Margin="5 0 0 0" VerticalAlignment="Center"
Foreground="White" FontWeight="Bold" FontSize="30"/>
</StackPanel>
</StackPanel>
</StackPanel>
<Grid Grid.Row="2">
<ContentControl Grid.Row="1" Grid.Column="2" x:Name="ContentControl" >
<!--<Frame Source="Views/RegexWindow.xaml"/>-->
</ContentControl>
</Grid>
</Grid>
<!--<Menu>
<MenuItem Header="开发工具">
<MenuItem Header="正则表达式" Click="Regex_Click"/>
<MenuItem Header="图标水印" Click="Ico_Click" />
<MenuItem Header="加密解密" Click="Security_Click"/>
<MenuItem Header="语音助手" Click="Speech_Click"/>
<Separator/>
<MenuItem Header="文件夹统计"/>
<MenuItem Header="文件编码"/>
</MenuItem>
<MenuItem Header="数据工具">
<MenuItem Header="数据建模"/>
</MenuItem>
<MenuItem Header="网络通信">
<MenuItem Header="网络工具" Click="Network_Click"/>
<MenuItem Header="RPC工具" />
<MenuItem Header="串口工具"/>
<MenuItem Header="地图接口"/>
</MenuItem>
<MenuItem Header="帮助">
<MenuItem Header="检查更新" Click="CheckUpdate_Click"/>
<MenuItem Header="关于" Click="About_Click"/>
</MenuItem>
</Menu>
<Frame x:Name="frame" NavigationUIVisibility="Hidden" Margin="0,24,0,0" />-->
</Grid>
</Window>