Skip to content

Commit a51f12c

Browse files
committed
move shadows resource dict to defaults, create light/dark color keys (still the same)
1 parent 86bd8eb commit a51f12c

7 files changed

+22
-18
lines changed

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Card.xaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,11 @@
33
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf"
44
xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters">
55

6-
<ResourceDictionary.MergedDictionaries>
7-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
8-
</ResourceDictionary.MergedDictionaries>
9-
106
<converters:CardClipConverter x:Key="CardClipConverter" />
117

128
<ControlTemplate TargetType="{x:Type wpf:Card}" x:Key="CardTemplate">
139
<Border Margin="{TemplateBinding Margin}"
14-
Effect="{StaticResource MaterialDesignShadowDepth2}"
10+
Effect="{DynamicResource MaterialDesignShadowDepth2}"
1511
CornerRadius="{TemplateBinding UniformCornerRadius}" Background="Transparent">
1612
<Border Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}"
1713
x:Name="PART_ClipBorder"

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Dark.xaml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,11 @@
1414

1515
<SolidColorBrush x:Key="MaterialDesignDivider" Color="#616161" />
1616
<SolidColorBrush x:Key="MaterialDesignSelection" Color="#757575" />
17-
17+
18+
<Color x:Key="MaterialDesignShadow1">#CCCCCC</Color>
19+
<Color x:Key="MaterialDesignShadow2">#C4C4C4</Color>
20+
<Color x:Key="MaterialDesignShadow3">#BBBBBB</Color>
21+
<Color x:Key="MaterialDesignShadow4">#BBBBBB</Color>
22+
<Color x:Key="MaterialDesignShadow5">#BBBBBB</Color>
23+
1824
</ResourceDictionary>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.DatePicker.xaml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
<ResourceDictionary.MergedDictionaries>
66
<ResourceDictionary Source="MaterialDesignTheme.Calendar.xaml" />
7-
<ResourceDictionary Source="MaterialDesignTheme.Shadows.xaml" />
87
</ResourceDictionary.MergedDictionaries>
98

109
<Style x:Key="MaterialDesignDatePickerTextBox" TargetType="{x:Type DatePickerTextBox}">
@@ -67,7 +66,7 @@
6766
<Setter Property="Template">
6867
<Setter.Value>
6968
<ControlTemplate TargetType="{x:Type Calendar}">
70-
<Border Effect="{StaticResource MaterialDesignShadowDepth4}" Padding="16 8 16 24">
69+
<Border Effect="{DynamicResource MaterialDesignShadowDepth4}" Padding="16 8 16 24">
7170
<CalendarItem x:Name="PART_CalendarItem" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}" Style="{DynamicResource MaterialDesignCalendarItemPortrait}"
7271
/>
7372
</Border>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Defaults.xaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
<!-- use this resource dictionary to set up the most common themese for standard controls -->
55

66
<ResourceDictionary.MergedDictionaries>
7+
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
78
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.button.xaml" />
89
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.calendar.xaml" />
910
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/materialdesigntheme.checkbox.xaml" />

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Light.xaml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,4 +14,10 @@
1414
<SolidColorBrush x:Key="MaterialDesignDivider" Color="#eeeeee" />
1515
<SolidColorBrush x:Key="MaterialDesignSelection" Color="#e0e0e0" />
1616

17+
<Color x:Key="MaterialDesignShadow1">#CCCCCC</Color>
18+
<Color x:Key="MaterialDesignShadow2">#C4C4C4</Color>
19+
<Color x:Key="MaterialDesignShadow3">#BBBBBB</Color>
20+
<Color x:Key="MaterialDesignShadow4">#BBBBBB</Color>
21+
<Color x:Key="MaterialDesignShadow5">#BBBBBB</Color>
22+
1723
</ResourceDictionary>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Shadows.xaml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,10 @@
33

44
<!-- thanks: http://marcangers.com/material-design-shadows-in-wpf/ -->
55

6-
<DropShadowEffect x:Key="MaterialDesignShadowDepth1" BlurRadius="5" ShadowDepth="1" Direction="270" Color="#CCCCCC"/>
7-
<DropShadowEffect x:Key="MaterialDesignShadowDepth2" BlurRadius="8" ShadowDepth="1.5" Direction="270" Color="#C4C4C4"/>
8-
<DropShadowEffect x:Key="MaterialDesignShadowDepth3" BlurRadius="14" ShadowDepth="4.5" Direction="270" Color="#BBBBBB"/>
9-
<DropShadowEffect x:Key="MaterialDesignShadowDepth4" BlurRadius="25" ShadowDepth="8" Direction="270" Color="#BBBBBB"/>
10-
<DropShadowEffect x:Key="MaterialDesignShadowDepth5" BlurRadius="35" ShadowDepth="13" Direction="270" Color="#BBBBBB"/>
6+
<DropShadowEffect x:Key="MaterialDesignShadowDepth1" BlurRadius="5" ShadowDepth="1" Direction="270" Color="{DynamicResource MaterialDesignShadow1}"/>
7+
<DropShadowEffect x:Key="MaterialDesignShadowDepth2" BlurRadius="8" ShadowDepth="1.5" Direction="270" Color="{DynamicResource MaterialDesignShadow2}"/>
8+
<DropShadowEffect x:Key="MaterialDesignShadowDepth3" BlurRadius="14" ShadowDepth="4.5" Direction="270" Color="{DynamicResource MaterialDesignShadow3}"/>
9+
<DropShadowEffect x:Key="MaterialDesignShadowDepth4" BlurRadius="25" ShadowDepth="8" Direction="270" Color="{DynamicResource MaterialDesignShadow4}"/>
10+
<DropShadowEffect x:Key="MaterialDesignShadowDepth5" BlurRadius="35" ShadowDepth="13" Direction="270" Color="{DynamicResource MaterialDesignShadow5}"/>
1111

1212
</ResourceDictionary>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.TimePicker.xaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,6 @@
33
xmlns:wpf="clr-namespace:MaterialDesignThemes.Wpf"
44
xmlns:converters="clr-namespace:MaterialDesignThemes.Wpf.Converters">
55

6-
<ResourceDictionary.MergedDictionaries>
7-
<ResourceDictionary Source="pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Shadows.xaml" />
8-
</ResourceDictionary.MergedDictionaries>
9-
106
<converters:TextFieldHintVisibilityConverter x:Key="TextFieldHintVisibilityConverter" />
117

128
<Style x:Key="MaterialDesignTimePicker" TargetType="{x:Type wpf:TimePicker}">
@@ -25,7 +21,7 @@
2521
<Setter Property="Template">
2622
<Setter.Value>
2723
<ControlTemplate TargetType="{x:Type ContentControl}">
28-
<Border Effect="{StaticResource MaterialDesignShadowDepth4}" Padding="16 8 16 24">
24+
<Border Effect="{DynamicResource MaterialDesignShadowDepth4}" Padding="16 8 16 24">
2925
<ContentPresenter Content="{TemplateBinding ContentControl.Content}" ContentTemplate="{TemplateBinding ContentControl.ContentTemplate}" ContentStringFormat="{TemplateBinding ContentControl.ContentStringFormat}" />
3026
</Border>
3127
</ControlTemplate>

0 commit comments

Comments
 (0)