forked from huqikuangmo/FrpcUI
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathApp.xaml
More file actions
527 lines (468 loc) · 27.8 KB
/
Copy pathApp.xaml
File metadata and controls
527 lines (468 loc) · 27.8 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
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
<Application x:Class="FrpcUI.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="clr-namespace:FrpcUI"
>
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Themes/LightTheme.xaml"/>
<ResourceDictionary Source="Assets/Icons/Icons.xaml"/>
<ResourceDictionary Source="Styles/MainStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style TargetType="Window">
<Setter Property="SnapsToDevicePixels" Value="True"/>
<EventSetter Event="Loaded" Handler="Window_Loaded" />
</Style>
<Style TargetType="ComboBox">
<Setter Property="Background" Value="White"/>
<Setter Property="BorderBrush" Value="#ABADB3"/>
</Style>
<Style x:Key="TitleText" TargetType="TextBlock">
<Setter Property="FontSize" Value="36" />
<Setter Property="FontWeight" Value="Bold" />
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="Foreground" Value="#FFFFFF" />
</Style>
<Style x:Key="NormalText" TargetType="TextBlock">
<Setter Property="FontSize" Value="16" />
<Setter Property="LineHeight" Value="28" />
<Setter Property="TextWrapping" Value="Wrap" />
<Setter Property="TextAlignment" Value="Center" />
<Setter Property="Foreground" Value="#FFFFFF" />
</Style>
<Style x:Key="button" TargetType="{x:Type Button}">
<Setter Property="FontSize" Value="14" />
<Setter Property="Width" Value="170" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="Foreground" Value="#FDFEFE" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" CornerRadius="25" BorderBrush="White" Padding="15" BorderThickness="1">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#e8e8e8" />
<Setter Property="Foreground" Value="DimGray" />
</Trigger>
<Trigger Property="IsMouseCaptured" Value="True">
<Setter Property="Background" Value="#d9d9d9" />
<Setter Property="Foreground" Value="DimGray" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="buttonCircle" TargetType="Button">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Margin" Value="8 0" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" CornerRadius="30" BorderBrush="#878787" Padding="15" BorderThickness="1">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#d9d9d9" />
</Trigger>
<Trigger Property="IsMouseCaptured" Value="True">
<Setter Property="Background" Value="#c4c4c4" />
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="imgClose" TargetType="Image">
<Setter Property="Width" Value="30" />
<Setter Property="Height" Value="30" />
<Setter Property="VerticalAlignment" Value="Top" />
<Setter Property="HorizontalAlignment" Value="Right" />
<Setter Property="Margin" Value="0 13 13 0" />
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform ScaleX="1.1" ScaleY="1.1"/>
</Setter.Value>
</Setter>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="textHint" TargetType="TextBlock">
<Setter Property="FontSize" Value="14" />
<Setter Property="Grid.Column" Value="1" />
<Setter Property="Panel.ZIndex" Value="1" />
<Setter Property="Margin" Value="10 0 0 0" />
<Setter Property="Foreground" Value="#ACB0AF" />
</Style>
<Style x:Key="textBox" TargetType="Control">
<Setter Property="FontSize" Value="14" />
<Setter Property="Grid.Column" Value="1" />
<Setter Property="Margin" Value="10 0 0 0" />
<Setter Property="Foreground" Value="#878787" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="BorderThickness" Value="0" />
</Style>
<!-- 隐藏导航栏的样式 -->
<Style x:Key="HiddenNavigationStyle" TargetType="NavigationWindow">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="NavigationWindow">
<ContentPresenter Content="{TemplateBinding Content}"/>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="mainButton" TargetType="{x:Type Button}">
<Setter Property="FontSize" Value="14" />
<Setter Property="Margin" Value="0 20 0 0" />
<Setter Property="Width" Value="200" />
<Setter Property="Background" Value="#FF4285F4" />
<Setter Property="Foreground" Value="#FDFEFE" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}" CornerRadius="25" BorderBrush="#FF4285F4" Padding="15" BorderThickness="1">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#3F7FDB" />
<Setter Property="Foreground" Value="White" />
</Trigger>
<Trigger Property="IsMouseCaptured" Value="True">
<Setter Property="Background" Value="#2C5FB3" />
<Setter Property="Foreground" Value="White" />
</Trigger>
</Style.Triggers>
</Style>
<!-- 其他资源 -->
<Style x:Key="RoundButtonStyle" TargetType="{x:Type Button}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type Button}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="0"
CornerRadius="10">
<!-- 设置圆角半径 -->
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- TabItem 样式 -->
<Style TargetType="TabItem" x:Key="TabItemStyle">
<Setter Property="FontWeight" Value="Bold"/>
<Setter Property="Foreground" Value="#666666"/>
<Setter Property="Height" Value="30"/>
<Style.Triggers>
<Trigger Property="IsSelected" Value="True">
<Setter Property="Foreground" Value="#6633CC"/>
<Setter Property="FontWeight" Value="Bold"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- ProgressBar 样式 -->
<Style TargetType="ProgressBar" x:Key="ProgressBarStyle">
<Setter Property="Foreground" Value="#8AC9DF"/>
<Setter Property="Background" Value="#E8F3F6"/>
</Style>
<!-- 文本框 样式 -->
<Style TargetType="TextBox" x:Key="TextBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border CornerRadius="4">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 现代按钮样式 -->
<Style x:Key="ModernButtonStyle" TargetType="Button">
<Setter Property="Background" Value="#FF4285F4"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border Background="{TemplateBinding Background}"
CornerRadius="4">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#3F7FDB"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#2C5FB3"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="BorderlessToggleButton" TargetType="ToggleButton">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border Background="Transparent">
<ContentPresenter HorizontalAlignment="Left"
VerticalAlignment="Center"/>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="Button" x:Key="ModernButton">
<Setter Property="Width" Value="100"/>
<Setter Property="Background" Value="#FF4285F4"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="#CCCCCC"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="Padding" Value="10,5"/>
<Setter Property="Margin" Value="0,0,10,0"/>
<Setter Property="FontWeight" Value="Medium"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="border"
CornerRadius="6"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<!-- 鼠标悬停效果 -->
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="border" Property="BorderBrush" Value="#777777"/>
</Trigger>
<!-- 按下效果 -->
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="border" Property="BorderBrush" Value="#777777"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- 特殊按钮样式 - 确定按钮 -->
<Style TargetType="Button" x:Key="PrimaryButton" BasedOn="{StaticResource ModernButton}">
<Setter Property="Background" Value="#4CAF50"/>
<Setter Property="Width" Value="50"/>
<Setter Property="Height" Value="25"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="#45A049"/>
<Setter Property="FontWeight" Value="SemiBold"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#43A047"/>
<Setter Property="BorderBrush" Value="#3D8B40"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#3D8B40"/>
<Setter Property="BorderBrush" Value="#367B39"/>
</Trigger>
</Style.Triggers>
</Style>
<!-- 特殊按钮样式 - 取消按钮 -->
<Style TargetType="Button" x:Key="DangerButton" BasedOn="{StaticResource ModernButton}">
<Setter Property="Width" Value="50"/>
<Setter Property="Background" Value="#F44336"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="BorderBrush" Value="#D32F2F"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="#E53935"/>
<Setter Property="BorderBrush" Value="#C62828"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="#D32F2F"/>
<Setter Property="BorderBrush" Value="#B71C1C"/>
</Trigger>
</Style.Triggers>
</Style>
<!--下拉框样式-->
<Style x:Key="RoundedComboBoxStyle" TargetType="ComboBox">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<!-- 主边框 -->
<Border x:Name="MainBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="8"/>
<!-- 内容区域 -->
<Grid Margin="2">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="20"/>
</Grid.ColumnDefinitions>
<!-- 显示选中项 -->
<ContentPresenter x:Name="ContentSite"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="Stretch"
VerticalAlignment="Center">
<ContentPresenter.Resources>
<Style TargetType="Border">
<Setter Property="CornerRadius" Value="5"/>
</Style>
</ContentPresenter.Resources>
</ContentPresenter>
<!-- 下拉按钮(带箭头图标) -->
<ToggleButton x:Name="ToggleButton"
Grid.Column="1"
Focusable="false"
IsChecked="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}"
ClickMode="Press">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<Border Background="Transparent">
<Path x:Name="Arrow"
Fill="#333333"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M0,0 L4,4 8,0 Z"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Arrow" Property="Fill" Value="#2080f0"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
</Grid>
<!-- 下拉弹出框 -->
<Popup x:Name="Popup"
Placement="Bottom"
IsOpen="{TemplateBinding IsDropDownOpen}"
AllowsTransparency="True"
Focusable="True"
StaysOpen="False"
PopupAnimation="Slide">
<Border x:Name="DropDownBorder"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="8"
Margin="0,5,0,0">
<ScrollViewer MaxHeight="{TemplateBinding MaxDropDownHeight}">
<ItemsPresenter/>
</ScrollViewer>
</Border>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Cursor" Value="Hand"/>
<Setter TargetName="MainBorder" Property="BorderBrush" Value="#555555"/>
</Trigger>
<Trigger Property="IsDropDownOpen" Value="True">
<Setter TargetName="MainBorder" Property="BorderBrush" Value="#333333"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="AnimatedRadioButton" TargetType="ToggleButton">
<Setter Property="Foreground" Value="Black"/>
<Setter Property="FontSize" Value="16"/>
<Setter Property="Margin" Value="0,10"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ToggleButton">
<Border Background="Transparent" Cursor="Hand">
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
<Grid Width="22" Height="22" Margin="0,0,10,0">
<Ellipse x:Name="OuterCircle" Stroke="#CCCCCC" StrokeThickness="2" Fill="Transparent"/>
<Ellipse x:Name="InnerCircle" Width="8" Height="8" Fill="#409EFF" Opacity="0" RenderTransformOrigin="0.5,0.5">
<Ellipse.RenderTransform>
<ScaleTransform ScaleX="0" ScaleY="0" />
</Ellipse.RenderTransform>
</Ellipse>
</Grid>
<ContentPresenter VerticalAlignment="Center"/>
</StackPanel>
</Border>
<ControlTemplate.Triggers>
<!-- 鼠标悬浮时文字变蓝 -->
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="#409EFF"/>
</Trigger>
<!-- 选中时小圆点动画出现 -->
<Trigger Property="IsChecked" Value="True">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="InnerCircle"
Storyboard.TargetProperty="Opacity"
To="1" Duration="0:0:0.2"/>
<DoubleAnimation Storyboard.TargetName="InnerCircle"
Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleX)"
To="1" Duration="0:0:0.2"
EasingFunction="{StaticResource EaseOut}"/>
<DoubleAnimation Storyboard.TargetName="InnerCircle"
Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleY)"
To="1" Duration="0:0:0.2"
EasingFunction="{StaticResource EaseOut}"/>
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Trigger.ExitActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation Storyboard.TargetName="InnerCircle"
Storyboard.TargetProperty="Opacity"
To="0" Duration="0:0:0.2"/>
<DoubleAnimation Storyboard.TargetName="InnerCircle"
Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleX)"
To="0" Duration="0:0:0.2"
EasingFunction="{StaticResource EaseOut}"/>
<DoubleAnimation Storyboard.TargetName="InnerCircle"
Storyboard.TargetProperty="RenderTransform.(ScaleTransform.ScaleY)"
To="0" Duration="0:0:0.2"
EasingFunction="{StaticResource EaseOut}"/>
</Storyboard>
</BeginStoryboard>
</Trigger.ExitActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<QuadraticEase x:Key="EaseOut" EasingMode="EaseOut"/>
</ResourceDictionary>
</Application.Resources>
</Application>