-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml
395 lines (364 loc) · 23.6 KB
/
App.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
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
<prism1:PrismApplication
x:Class="UI.Code.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:con="clr-namespace:UI.Code.Convertor"
xmlns:img="clr-namespace:UI.Code.View"
xmlns:local="clr-namespace:UI.Code"
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
xmlns:prism="http://prismlibrary.com"
xmlns:prism1="http://prismlibrary.com/"
xmlns:style="clr-namespace:UI.Code.Style"
xmlns:wpf="http://materialdesigninxaml.net/winfx/xaml/themes">
<prism1:PrismApplication.Resources>
<ResourceDictionary>
<BitmapImage x:Key="Icon_FolderOpen" UriSource="pack://application:,,,/Icons/folder.ico" />
<BitmapImage x:Key="Icon_FolderClosed" UriSource="pack://application:,,,/Icons/folder.ico" />
<con:ColorFConverter x:Key="ColorFConverter" />
<Style x:Key="IconImageStyleSmall" TargetType="Image">
<Setter Property="MaxWidth" Value="16" />
<Setter Property="MaxHeight" Value="16" />
<Setter Property="Margin" Value="1" />
</Style>
<SolidColorBrush x:Key="{x:Static SystemColors.HighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="{x:Static SystemColors.InactiveSelectionHighlightBrushKey}" Color="Transparent" />
<SolidColorBrush x:Key="AppMainColor" Color="#0862c4" />
<Style
x:Key="ImgBtn"
BasedOn="{StaticResource MaterialDesignToolButton}"
TargetType="Button">
<Setter Property="Height" Value="44" />
<Setter Property="Width" Value="44" />
<Setter Property="Foreground" Value="{StaticResource AppMainColor}" />
</Style>
<Style x:Key="brdProgress" TargetType="Border">
<Setter Property="BorderThickness" Value="1" />
<Setter Property="Background" Value="#80000000" />
<Setter Property="BorderBrush" Value="Black" />
</Style>
<Style
x:Key="btn"
BasedOn="{StaticResource MaterialDesignFlatDarkBgButton}"
TargetType="Button">
<Setter Property="Height" Value="25" />
<Setter Property="FontSize" Value="10" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style
x:Key="Svebtn"
BasedOn="{StaticResource MaterialDesignFlatDarkBgButton}"
TargetType="Button">
<Setter Property="Height" Value="30" />
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style TargetType="materialDesign:PackIcon">
<Setter Property="Height" Value="30" />
<Setter Property="Width" Value="30" />
<Setter Property="Background" Value="Transparent" />
</Style>
<Style
x:Key="Error"
BasedOn="{StaticResource MaterialDesignSubtitle2TextBlock}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="Red" />
</Style>
<Style
x:Key="Title"
BasedOn="{StaticResource MaterialDesignHeadline6TextBlock}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="18" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style
x:Key="Des"
BasedOn="{StaticResource MaterialDesignHeadline6TextBlock}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="14" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style
x:Key="Large"
BasedOn="{StaticResource MaterialDesignHeadline6TextBlock}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="18" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style
x:Key="Medium"
BasedOn="{StaticResource MaterialDesignHeadline6TextBlock}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="White" />
</Style>
<Style
x:Key="Label"
BasedOn="{StaticResource MaterialDesignHeadline6TextBlock}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="Black" />
</Style>
<Style
x:Key="Labelgv"
BasedOn="{StaticResource MaterialDesignCaptionTextBlock}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="15" />
<Setter Property="Foreground" Value="Black" />
</Style>
<Style
x:Key="Small"
BasedOn="{StaticResource MaterialDesignHeadline6TextBlock}"
TargetType="TextBlock">
<Setter Property="FontSize" Value="10" />
<Setter Property="Foreground" Value="White" />
</Style>
<!--<Style TargetType="ListViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>-->
<Style x:Key="HorizontalRadioButtonList" TargetType="{x:Type ListBox}">
<Setter Property="Background" Value="Red" />
<Setter Property="ItemsPanel">
<Setter.Value>
<ItemsPanelTemplate>
<VirtualizingStackPanel Background="Transparent" Orientation="Horizontal" />
</ItemsPanelTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="{x:Type ListBoxItem}">
<Setter Property="Margin" Value="5,0,0,0" />
<Setter Property="FontWeight" Value="Normal" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBoxItem}">
<Border Background="Transparent" BorderThickness="0">
<RadioButton
Focusable="False"
FontWeight="Normal"
IsChecked="{TemplateBinding IsSelected}"
IsHitTestVisible="False">
<ContentPresenter />
</RadioButton>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListBox}">
<Border
Name="Bd"
Padding="0"
Background="Transparent"
BorderBrush="Transparent"
BorderThickness="0"
SnapsToDevicePixels="True">
<ItemsPresenter SnapsToDevicePixels="{TemplateBinding UIElement.SnapsToDevicePixels}" />
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="MyFocusVisual">
<Setter Property="Control.Template">
<Setter.Value>
<ControlTemplate>
<Rectangle
Margin="-2"
Fill="Orange"
Stroke="Red"
StrokeDashArray="1 2"
StrokeThickness="1" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<SolidColorBrush x:Key="PrimaryHueLightBrush" Color="#0862c4" />
<SolidColorBrush x:Key="PrimaryHueMidBrush" Color="#0862c4" />
<SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="#0862c4" />
<SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="#FFFFFF" />
<SolidColorBrush x:Key="PrimaryHueDarkForegroundBrush" Color="#FFFFFF" />
<SolidColorBrush x:Key="SecondaryAccentBrush" Color="#0862c4" />
<SolidColorBrush x:Key="SecondaryAccentForegroundBrush" Color="#0862c4" />
<!--<SolidColorBrush x:Key="PrimaryHueLightBrush" Color="#2e479b"/>
<SolidColorBrush x:Key="PrimaryHueLightForegroundBrush" Color="#FFFFFF"/>
<SolidColorBrush x:Key="PrimaryHueMidBrush" Color="#2e479b"/>
<SolidColorBrush x:Key="PrimaryHueMidForegroundBrush" Color="#FFFFFF"/>
<SolidColorBrush x:Key="PrimaryHueDarkBrush" Color="#2e479b"/>
-->
<!-- accent -->
<!--
-->
<Style x:Key="MaterialDesignDatePicker1" TargetType="{x:Type DatePicker}">
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Foreground" Value="{Binding RelativeSource={RelativeSource AncestorType={x:Type FrameworkElement}}, Path=(TextElement.Foreground)}" />
<Setter Property="CalendarStyle" Value="{StaticResource MaterialDesignDatePickerCalendarPortrait}" />
<Setter Property="IsTodayHighlighted" Value="True" />
<Setter Property="SelectedDateFormat" Value="Short" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextBoxBorder}" />
<Setter Property="BorderThickness" Value="0,0,0,1" />
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
<Setter Property="Padding" Value="{x:Static wpf:Constants.TextBoxDefaultPadding}" />
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMargin}" />
<Setter Property="Validation.ErrorTemplate" Value="{StaticResource MaterialDesignValidationErrorTemplate}" />
<Setter Property="wpf:TextFieldAssist.UnderlineBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
<Setter Property="wpf:HintAssist.Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type DatePicker}">
<ControlTemplate.Resources>
<ControlTemplate x:Key="CalendarButtonTemplate" TargetType="{x:Type Button}">
<wpf:PackIcon
Width="20"
Height="20"
VerticalAlignment="Center"
Background="Transparent"
Foreground="{TemplateBinding Foreground}"
Kind="Calendar" />
</ControlTemplate>
</ControlTemplate.Resources>
<Grid x:Name="PART_Root">
<DatePickerTextBox
x:Name="PART_TextBox"
Grid.Row="0"
Grid.Column="0"
HorizontalAlignment="Stretch"
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalContentAlignment="Center"
wpf:HintAssist.FloatingOffset="{TemplateBinding wpf:HintAssist.FloatingOffset}"
wpf:HintAssist.FloatingScale="{TemplateBinding wpf:HintAssist.FloatingScale}"
wpf:HintAssist.Foreground="{TemplateBinding wpf:HintAssist.Foreground}"
wpf:HintAssist.HelperText="{TemplateBinding wpf:HintAssist.HelperText}"
wpf:HintAssist.HelperTextFontSize="{TemplateBinding wpf:HintAssist.HelperTextFontSize}"
wpf:HintAssist.Hint="{TemplateBinding wpf:HintAssist.Hint}"
wpf:HintAssist.HintOpacity="{TemplateBinding wpf:HintAssist.HintOpacity}"
wpf:HintAssist.IsFloating="{TemplateBinding wpf:HintAssist.IsFloating}"
wpf:TextFieldAssist.DecorationVisibility="{TemplateBinding wpf:TextFieldAssist.DecorationVisibility}"
wpf:TextFieldAssist.HasClearButton="{TemplateBinding wpf:TextFieldAssist.HasClearButton}"
wpf:TextFieldAssist.HasFilledTextField="{TemplateBinding wpf:TextFieldAssist.HasFilledTextField}"
wpf:TextFieldAssist.HasOutlinedTextField="{TemplateBinding wpf:TextFieldAssist.HasOutlinedTextField}"
wpf:TextFieldAssist.NewSpecHighlightingEnabled="{TemplateBinding wpf:TextFieldAssist.NewSpecHighlightingEnabled}"
wpf:TextFieldAssist.PrefixText="{TemplateBinding wpf:TextFieldAssist.PrefixText}"
wpf:TextFieldAssist.RippleOnFocusEnabled="{TemplateBinding wpf:TextFieldAssist.RippleOnFocusEnabled}"
wpf:TextFieldAssist.SuffixText="{TemplateBinding wpf:TextFieldAssist.SuffixText}"
wpf:TextFieldAssist.TextBoxViewMargin="{TemplateBinding wpf:TextFieldAssist.TextBoxViewMargin}"
wpf:TextFieldAssist.TextFieldCornerRadius="{TemplateBinding wpf:TextFieldAssist.TextFieldCornerRadius}"
wpf:TextFieldAssist.UnderlineBrush="{TemplateBinding wpf:TextFieldAssist.UnderlineBrush}"
wpf:TextFieldAssist.UnderlineCornerRadius="{TemplateBinding wpf:TextFieldAssist.UnderlineCornerRadius}"
BorderBrush="{TemplateBinding BorderBrush}"
Focusable="{TemplateBinding Focusable}"
Style="{DynamicResource MaterialDesignDatePickerTextBox}">
<DatePickerTextBox.Padding>
<MultiBinding Converter="{StaticResource PickerInnerPaddingConverter}">
<Binding Path="Padding" RelativeSource="{RelativeSource TemplatedParent}" />
<Binding
ElementName="PART_Button"
Mode="OneWay"
Path="ActualWidth" />
</MultiBinding>
</DatePickerTextBox.Padding>
</DatePickerTextBox>
<Button
x:Name="PART_Button"
Height="16"
Margin="{TemplateBinding Padding,
Converter={StaticResource PickerInnerPaddingConverter}}"
HorizontalAlignment="Right"
VerticalAlignment="Center"
Focusable="False"
Foreground="{TemplateBinding BorderBrush}"
Template="{StaticResource CalendarButtonTemplate}" />
<Popup
x:Name="PART_Popup"
AllowsTransparency="True"
CustomPopupPlacementCallback="{x:Static wpf:CustomPopupPlacementCallbackHelper.LargePopupCallback}"
Placement="Custom"
PlacementTarget="{Binding ElementName=PART_TextBox}"
PopupAnimation="Fade"
StaysOpen="False" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="wpf:TextFieldAssist.HasFilledTextField" Value="True">
<Setter Property="Padding" Value="16,8" />
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxBackground}" />
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
</Trigger>
<Trigger Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True">
<Setter Property="Padding" Value="16" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaBorder}" />
<Setter Property="wpf:TextFieldAssist.TextBoxViewMargin" Value="{x:Static wpf:Constants.DefaultTextBoxViewMarginEmbedded}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="False" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="False" />
<Condition Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{DynamicResource PrimaryHueMidBrush}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="True" />
<Condition SourceName="PART_Button" Property="IsMouseOver" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_Button" Property="Foreground" Value="{DynamicResource PrimaryHueMidBrush}" />
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="PART_Button" Property="Opacity" Value="{x:Static wpf:Constants.TextBoxNotEnabledOpacity}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsEnabled" Value="False" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_TextBox" Property="BorderBrush" Value="{DynamicResource MaterialDesignTextAreaInactiveBorder}" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition SourceName="PART_TextBox" Property="IsKeyboardFocused" Value="True" />
<Condition Property="wpf:TextFieldAssist.HasOutlinedTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter TargetName="PART_TextBox" Property="BorderBrush" Value="{Binding Path=(wpf:TextFieldAssist.UnderlineBrush), RelativeSource={RelativeSource Self}}" />
</MultiTrigger>
<Trigger Property="wpf:CalendarAssist.IsHeaderVisible" Value="False">
<Setter Property="CalendarStyle">
<Setter.Value>
<Style BasedOn="{StaticResource MaterialDesignDatePickerCalendarPortrait}" TargetType="Calendar">
<Setter Property="wpf:CalendarAssist.IsHeaderVisible" Value="False" />
</Style>
</Setter.Value>
</Setter>
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IsMouseOver" Value="True" />
<Condition Property="wpf:TextFieldAssist.HasFilledTextField" Value="True" />
</MultiTrigger.Conditions>
<Setter Property="Background" Value="{DynamicResource MaterialDesignTextFieldBoxHoverBackground}" />
</MultiTrigger>
<Trigger Property="Validation.HasError" Value="True">
<Setter TargetName="PART_TextBox" Property="wpf:ValidationAssist.HasError" Value="True" />
<Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignValidationErrorBrush}" />
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<ResourceDictionary.MergedDictionaries>
<!--<style:SkinResourceDictionary DarkSource="Style/Dark.xaml"
LightSource="Style/Light.xaml" />-->
<ResourceDictionary Source="Style/Style.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Light.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Primary/MaterialDesignColor.Blue.xaml" />
<ResourceDictionary Source="pack://application:,,,/MaterialDesignColors;component/Themes/Recommended/Accent/MaterialDesignColor.Indigo.xaml" />
</ResourceDictionary.MergedDictionaries>
</ResourceDictionary>
</prism1:PrismApplication.Resources>
</prism1:PrismApplication>