Skip to content

Commit 1268b7d

Browse files
committed
use MaterialDesignShadowDepth1 and MaterialDesignShadowDepth2
1 parent 5054b4f commit 1268b7d

File tree

4 files changed

+7
-28
lines changed

4 files changed

+7
-28
lines changed

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Button.xaml

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -30,11 +30,7 @@
3030
<Setter.Value>
3131
<ControlTemplate TargetType="{x:Type Button}">
3232
<Grid>
33-
<Border Background="{TemplateBinding Background}">
34-
<Border.Effect>
35-
<DropShadowEffect BlurRadius="5" ShadowDepth="1" Direction="270" Color="#CCCCCC" />
36-
</Border.Effect>
37-
</Border>
33+
<Border Background="{TemplateBinding Background}" Effect="{DynamicResource MaterialDesignShadowDepth1}" />
3834
<Border Background="{TemplateBinding Background}" x:Name="border" CornerRadius="2">
3935
<wpf:VisualFeedbackContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Focusable="False"
4036
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
@@ -131,12 +127,8 @@
131127
<Setter.Value>
132128
<ControlTemplate TargetType="{x:Type Button}">
133129
<Grid>
134-
<Ellipse Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}"
135-
x:Name="border">
136-
<Ellipse.Effect>
137-
<DropShadowEffect BlurRadius="5" ShadowDepth="1" Direction="270" Color="#CCCCCC"/>
138-
</Ellipse.Effect>
139-
</Ellipse>
130+
<Ellipse Fill="{TemplateBinding Background}" Stroke="{TemplateBinding BorderBrush}" StrokeThickness="{TemplateBinding BorderThickness}" Effect="{DynamicResource MaterialDesignShadowDepth1}"
131+
x:Name="border" />
140132
<wpf:VisualFeedbackContentControl Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Focusable="False"
141133
Clip="{Binding ElementName=GeometryEllipse, Path=RenderedGeometry}" ClipToBounds="True"
142134
HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ComboBox.xaml

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -154,10 +154,7 @@
154154
<Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, Mode=TwoWay, RelativeSource={RelativeSource TemplatedParent}}" Margin="1" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
155155
<Border x:Name="shadow" Background="{DynamicResource MaterialDesignPaper}" CornerRadius="2"
156156
MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}"
157-
BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}">
158-
<Border.Effect>
159-
<DropShadowEffect BlurRadius="8" ShadowDepth="1.5" Direction="270" Color="Black" Opacity=".23"/>
160-
</Border.Effect>
157+
BorderThickness="1" BorderBrush="{DynamicResource MaterialDesignDivider}" Effect="{DynamicResource MaterialDesignShadowDepth2}">
161158
<Border x:Name="dropDownBorder" Background="Transparent">
162159
<ScrollViewer x:Name="DropDownScrollViewer">
163160
<Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
@@ -240,10 +237,7 @@
240237
<Popup x:Name="PART_Popup" AllowsTransparency="true" Grid.ColumnSpan="2" IsOpen="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}}" PopupAnimation="{DynamicResource {x:Static SystemParameters.ComboBoxPopupAnimationKey}}" Placement="Bottom">
241238
<Border x:Name="dropDownBorder" BorderBrush="{DynamicResource MaterialDesignDivider}" BorderThickness="1" Background="{DynamicResource MaterialDesignPaper}"
242239
CornerRadius="2"
243-
MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}">
244-
<Border.Effect>
245-
<DropShadowEffect BlurRadius="8" ShadowDepth="1.5" Direction="270" Color="Black" Opacity=".23"/>
246-
</Border.Effect>
240+
MaxHeight="{TemplateBinding MaxDropDownHeight}" MinWidth="{Binding ActualWidth, ElementName=templateRoot}" Effect="{DynamicResource MaterialDesignShadowDepth2}">
247241
<ScrollViewer x:Name="DropDownScrollViewer">
248242
<Grid x:Name="grid" RenderOptions.ClearTypeHint="Enabled">
249243
<Canvas x:Name="canvas" HorizontalAlignment="Left" Height="0" VerticalAlignment="Top" Width="0">

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ListBox.xaml

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -92,11 +92,7 @@
9292
<ControlTemplate TargetType="{x:Type ListBoxItem}">
9393
<Grid>
9494
<Border CornerRadius="2"
95-
Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
96-
<Border.Effect>
97-
<DropShadowEffect BlurRadius="8" ShadowDepth="2.5" Direction="270" Color="Black" Opacity=".23"/>
98-
</Border.Effect>
99-
</Border>
95+
Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true" Effect="{DynamicResource MaterialDesignShadowDepth2}" />
10096
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
10197
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true"
10298
CornerRadius="2"/>

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.ToggleButton.xaml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@
171171
<Viewbox Width="34">
172172
<Grid>
173173
<Rectangle x:Name="Track" Fill="Black" HorizontalAlignment="Left" Height="15" Margin="4.211,5,-4.211,0" Stroke="{x:Null}" VerticalAlignment="Top" Width="40" RadiusY="7.5" RadiusX="7.5" Opacity="0.26"/>
174-
<Ellipse x:Name="Thumb" Fill="#FFFAFAFA" HorizontalAlignment="Left" Height="25" Margin="0,0,0,0" Stroke="{x:Null}" VerticalAlignment="Top" Width="25" RenderTransformOrigin="0.5,0.5">
174+
<Ellipse x:Name="Thumb" Fill="#FFFAFAFA" HorizontalAlignment="Left" Height="25" Margin="0,0,0,0" Stroke="{x:Null}" VerticalAlignment="Top" Width="25" RenderTransformOrigin="0.5,0.5" Effect="{DynamicResource MaterialDesignShadowDepth1}">
175175
<Ellipse.RenderTransform>
176176
<TransformGroup>
177177
<ScaleTransform/>
@@ -180,9 +180,6 @@
180180
<TranslateTransform/>
181181
</TransformGroup>
182182
</Ellipse.RenderTransform>
183-
<Ellipse.Effect>
184-
<DropShadowEffect BlurRadius="5" ShadowDepth="1" Direction="270" Color="#CCCCCC"/>
185-
</Ellipse.Effect>
186183
</Ellipse>
187184
</Grid>
188185
</Viewbox>

0 commit comments

Comments
 (0)