-
-
Notifications
You must be signed in to change notification settings - Fork 2.4k
/
App.xaml
98 lines (90 loc) · 6.77 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
<Application x:Class="MetroDemo.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
StartupUri="MainWindow.xaml">
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
<ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Themes/Light.Blue.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style x:Key="DescriptionHeaderStyle"
BasedOn="{StaticResource {x:Type Label}}"
TargetType="{x:Type Label}">
<Setter Property="FontSize" Value="22" />
<Setter Property="HorizontalAlignment" Value="Center" />
</Style>
<Style BasedOn="{StaticResource MahApps.Styles.CustomValidationPopup}" TargetType="{x:Type mah:CustomValidationPopup}">
<Setter Property="CloseOnMouseLeftButtonDown" Value="False" />
<Setter Property="ShowValidationErrorOnMouseOver" Value="False" />
</Style>
<!-- quick change of the collapse storyboard duration -->
<Storyboard x:Key="MahApps.Storyboard.Expander.Collapse.Fast">
<DoubleAnimation Storyboard.TargetName="ExpandSite"
Storyboard.TargetProperty="(UIElement.Opacity)"
From="1"
To="0"
Duration="0:0:0.1" />
<ObjectAnimationUsingKeyFrames Storyboard.TargetName="ExpandSite" Storyboard.TargetProperty="(UIElement.Visibility)">
<DiscreteObjectKeyFrame KeyTime="0:0:0.1" Value="{x:Static Visibility.Collapsed}" />
</ObjectAnimationUsingKeyFrames>
</Storyboard>
<Style BasedOn="{StaticResource MahApps.Styles.Expander}" TargetType="{x:Type Expander}">
<Setter Property="mah:ExpanderHelper.CollapseStoryboard" Value="{StaticResource MahApps.Storyboard.Expander.Collapse.Fast}" />
</Style>
<Style x:Key="MahApps.Styles.MetroHeader.Horizontal"
BasedOn="{StaticResource MahApps.Styles.MetroHeader}"
TargetType="mah:MetroHeader">
<Setter Property="Padding" Value="0 2" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="mah:MetroHeader">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" SharedSizeGroup="HeaderGroup" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Grid Grid.Column="0" Background="{TemplateBinding mah:HeaderedControlHelper.HeaderBackground}">
<mah:ContentControlEx x:Name="PART_Header"
Margin="{TemplateBinding mah:HeaderedControlHelper.HeaderMargin}"
HorizontalAlignment="{TemplateBinding mah:HeaderedControlHelper.HeaderHorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding mah:HeaderedControlHelper.HeaderVerticalContentAlignment}"
Content="{TemplateBinding Header}"
ContentCharacterCasing="{TemplateBinding mah:ControlsHelper.ContentCharacterCasing}"
ContentStringFormat="{TemplateBinding HeaderStringFormat}"
ContentTemplate="{TemplateBinding HeaderTemplate}"
ContentTemplateSelector="{TemplateBinding HeaderTemplateSelector}"
FontFamily="{TemplateBinding mah:HeaderedControlHelper.HeaderFontFamily}"
FontSize="{TemplateBinding mah:HeaderedControlHelper.HeaderFontSize}"
FontStretch="{TemplateBinding mah:HeaderedControlHelper.HeaderFontStretch}"
FontWeight="{TemplateBinding mah:HeaderedControlHelper.HeaderFontWeight}"
Foreground="{TemplateBinding mah:HeaderedControlHelper.HeaderForeground}"
IsTabStop="False"
RecognizesAccessKey="{TemplateBinding mah:ControlsHelper.RecognizesAccessKey}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
<Grid Grid.Column="1" Background="{TemplateBinding Background}">
<ContentPresenter x:Name="PART_Content"
Margin="{TemplateBinding Padding}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
ContentSource="Content"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
</Grid>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="mah:HeaderedControlHelper.HeaderMargin" Value="0 0 4 0" />
<Setter Property="mah:HeaderedControlHelper.HeaderVerticalContentAlignment" Value="Center" />
</Style>
<Style x:Key="MahApps.Styles.ColorPalette.ColorPickerDropDown"
BasedOn="{StaticResource MahApps.Styles.ColorPalette}"
TargetType="{x:Type mah:ColorPalette}">
<Setter Property="mah:ControlsHelper.ContentCharacterCasing" Value="Normal" />
</Style>
</ResourceDictionary>
</Application.Resources>
</Application>