Skip to content

Commit af0972f

Browse files
authored
Replaced ShadowDepth with Elevation (#2786)
* Replaced ShadowDepth with Elevation * Replaced additional ShadowDepth uses A couple more were added in other PRs
1 parent d1489c7 commit af0972f

File tree

64 files changed

+792
-867
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

64 files changed

+792
-867
lines changed

MainDemo.Wpf/Cards.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -425,7 +425,7 @@
425425
UniqueKey="cards_8"
426426
Margin="4 4 0 0"
427427
VerticalContentAlignment="Top">
428-
<materialDesign:Flipper Style="{StaticResource MaterialDesignCardFlipper}" materialDesign:ShadowAssist.ShadowDepth="Depth0">
428+
<materialDesign:Flipper Style="{StaticResource MaterialDesignCardFlipper}" materialDesign:ElevationAssist.Elevation="Dp0">
429429
<materialDesign:Flipper.FrontContent>
430430
<Grid Height="256" Width="200">
431431
<Grid.RowDefinitions>

MainDemo.Wpf/ColorTool.xaml

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828

2929
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignRaisedButton}">
3030
<Setter Property="BorderBrush" Value="Transparent" />
31-
<Setter Property="materialDesign:ShadowAssist.ShadowDepth" Value="Depth0" />
31+
<Setter Property="materialDesign:ElevationAssist.Elevation" Value="Dp0" />
3232
</Style>
3333

3434
<Style TargetType="TextBlock" x:Key="HexLabelTextBlock" BasedOn="{StaticResource MaterialDesignBody2TextBlock}">
@@ -53,7 +53,7 @@
5353
<Setter Property="BorderThickness" Value="0" />
5454
<Setter Property="Margin" Value="1 1 0 0" />
5555
<Setter Property="materialDesign:RippleAssist.IsDisabled" Value="True" />
56-
<Setter Property="materialDesign:ShadowAssist.ShadowDepth" Value="Depth0" />
56+
<Setter Property="materialDesign:ElevationAssist.Elevation" Value="Dp0" />
5757
<Setter Property="Tag" Value="0" />
5858
<Style.Triggers>
5959
<Trigger Property="IsMouseOver" Value="True">
@@ -133,7 +133,7 @@
133133
<Grid.Resources>
134134
<Style TargetType="Button" BasedOn="{StaticResource MaterialDesignRaisedButton}" x:Key="PaletteButton">
135135
<Setter Property="BorderBrush" Value="Transparent" />
136-
<Setter Property="materialDesign:ShadowAssist.ShadowDepth" Value="Depth0" />
136+
<Setter Property="materialDesign:ElevationAssist.Elevation" Value="Dp0" />
137137
<Setter Property="materialDesign:ShadowAssist.ShadowEdges" Value="All" />
138138
<Setter Property="materialDesign:RippleAssist.Feedback" Value="LightGray" />
139139
<Setter Property="materialDesign:RippleAssist.RippleOnTop" Value="True" />
@@ -165,7 +165,7 @@
165165
<Style TargetType="Button" BasedOn="{StaticResource PaletteButton}">
166166
<Style.Triggers>
167167
<DataTrigger Binding="{Binding ActiveScheme}" Value="Primary">
168-
<Setter Property="materialDesign:ShadowAssist.ShadowDepth" Value="Depth3" />
168+
<Setter Property="materialDesign:ElevationAssist.Elevation" Value="Dp8" />
169169
</DataTrigger>
170170
</Style.Triggers>
171171
</Style>
@@ -260,7 +260,7 @@
260260
<Style TargetType="Button" BasedOn="{StaticResource PaletteButton}">
261261
<Style.Triggers>
262262
<DataTrigger Binding="{Binding ActiveScheme}" Value="Secondary">
263-
<Setter Property="materialDesign:ShadowAssist.ShadowDepth" Value="Depth3" />
263+
<Setter Property="materialDesign:ElevationAssist.Elevation" Value="Dp8" />
264264
</DataTrigger>
265265
</Style.Triggers>
266266
</Style>
@@ -358,7 +358,7 @@
358358
<Style TargetType="Button" BasedOn="{StaticResource PaletteButton}">
359359
<Style.Triggers>
360360
<DataTrigger Binding="{Binding ActiveScheme}" Value="PrimaryForeground">
361-
<Setter Property="materialDesign:ShadowAssist.ShadowDepth" Value="Depth3" />
361+
<Setter Property="materialDesign:ElevationAssist.Elevation" Value="Dp8" />
362362
</DataTrigger>
363363
</Style.Triggers>
364364
</Style>
@@ -429,7 +429,7 @@
429429
<Style TargetType="Button" BasedOn="{StaticResource PaletteButton}">
430430
<Style.Triggers>
431431
<DataTrigger Binding="{Binding ActiveScheme}" Value="SecondaryForeground">
432-
<Setter Property="materialDesign:ShadowAssist.ShadowDepth" Value="Depth3" />
432+
<Setter Property="materialDesign:ElevationAssist.Elevation" Value="Dp8" />
433433
</DataTrigger>
434434
</Style.Triggers>
435435
</Style>

MainDemo.Wpf/ColorZones.xaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@
123123
CornerRadius="2"
124124
Panel.ZIndex="1"
125125
Margin="16 0 0 0"
126-
materialDesign:ShadowAssist.ShadowDepth="Depth1">
126+
materialDesign:ElevationAssist.Elevation="Dp2">
127127
<Grid>
128128
<Grid.ColumnDefinitions>
129129
<ColumnDefinition Width="Auto" />
@@ -177,7 +177,7 @@
177177
Mode="PrimaryDark"
178178
Padding="16"
179179
CornerRadius="10"
180-
materialDesign:ShadowAssist.ShadowDepth="Depth3"
180+
materialDesign:ElevationAssist.Elevation="Dp4"
181181
ClipToBounds="False">
182182
<StackPanel Orientation="Horizontal">
183183
<ToggleButton

MainDemo.Wpf/Domain/DocumentationLink.cs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,9 @@ public static DocumentationLink DemoPageLink<TDemoPage>(string? label, string? @
7777
label ?? typeof(TDemoPage).Name);
7878
}
7979

80+
public static DocumentationLink SpecsLink(string url, string? label)
81+
=> new(DocumentationLinkType.Specs, url, label ?? "Specs");
82+
8083
public string Label { get; }
8184

8285
public string Url { get; }

MainDemo.Wpf/Domain/DocumentationLinkType.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ public enum DocumentationLinkType
66
DemoPageSource,
77
ControlSource,
88
StyleSource,
9-
Video
9+
Video,
10+
Specs
1011
}
1112
}

MainDemo.Wpf/Domain/DocumentationLinks.xaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,10 @@
4141
<Setter TargetName="PackIcon" Property="Kind" Value="CodeBraces" />
4242
<Setter TargetName="Root" Property="ToolTip" Value="Object Source/API" />
4343
</DataTrigger>
44+
<DataTrigger Binding="{Binding Type}" Value="Specs">
45+
<Setter TargetName="PackIcon" Property="Kind" Value="MaterialDesign" />
46+
<Setter TargetName="Root" Property="ToolTip" Value="Material Design Specs" />
47+
</DataTrigger>
4448
</DataTemplate.Triggers>
4549
</DataTemplate>
4650
</ResourceDictionary>

MainDemo.Wpf/Domain/MainWindowViewModel.cs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -412,11 +412,13 @@ private static IEnumerable<DemoItem> GenerateDemoItems(ISnackbarMessageQueue sna
412412
});
413413

414414
yield return new DemoItem(
415-
"Shadows",
416-
typeof(Shadows),
415+
"Elevation",
416+
typeof(Elevation),
417417
new[]
418418
{
419-
DocumentationLink.DemoPageLink<Shadows>(),
419+
DocumentationLink.DemoPageLink<Elevation>(),
420+
DocumentationLink.StyleLink("Shadows"),
421+
DocumentationLink.SpecsLink("https://material.io/design/environment/elevation.html", "Elevation")
420422
});
421423
}
422424

MainDemo.Wpf/Elevation.xaml

Lines changed: 193 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,193 @@
1+
<UserControl
2+
x:Class="MaterialDesignDemo.Elevation"
3+
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
4+
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
5+
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
6+
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
7+
xmlns:materialDesign="http://materialdesigninxaml.net/winfx/xaml/themes"
8+
xmlns:smtx="clr-namespace:ShowMeTheXAML;assembly=ShowMeTheXAML"
9+
mc:Ignorable="d"
10+
d:DesignHeight="300"
11+
d:DesignWidth="300">
12+
<StackPanel Margin="8 8 0 0">
13+
<TextBlock
14+
Text="Elevated controls have default elevation set, but the elevation can be overriden."/>
15+
16+
<WrapPanel
17+
Orientation="Horizontal"
18+
Margin="0 12 0 0">
19+
<smtx:XamlDisplay
20+
UniqueKey="shadow_1"
21+
Margin="0 0 16 32">
22+
<Button
23+
Style="{StaticResource MaterialDesignRaisedButton}"
24+
Content="2 DP"/>
25+
</smtx:XamlDisplay>
26+
27+
<smtx:XamlDisplay
28+
UniqueKey="shadow_2"
29+
Margin="0 0 16 32">
30+
<Button
31+
Style="{StaticResource MaterialDesignRaisedButton}"
32+
materialDesign:ElevationAssist.Elevation="Dp4"
33+
Content="4 DP"/>
34+
</smtx:XamlDisplay>
35+
36+
<smtx:XamlDisplay
37+
UniqueKey="shadow_3"
38+
Margin="0 0 16 32">
39+
<Button
40+
Style="{StaticResource MaterialDesignRaisedButton}"
41+
materialDesign:ElevationAssist.Elevation="Dp8"
42+
Content="8 DP"/>
43+
</smtx:XamlDisplay>
44+
45+
<smtx:XamlDisplay
46+
UniqueKey="shadow_4"
47+
Margin="0 0 16 32">
48+
<Button
49+
Style="{StaticResource MaterialDesignRaisedButton}"
50+
materialDesign:ElevationAssist.Elevation="Dp12"
51+
Content="12 DP"/>
52+
</smtx:XamlDisplay>
53+
54+
<smtx:XamlDisplay
55+
UniqueKey="shadow_5"
56+
Margin="0 0 16 32">
57+
<Button
58+
Style="{StaticResource MaterialDesignRaisedButton}"
59+
materialDesign:ElevationAssist.Elevation="Dp16"
60+
Content="16 DP"/>
61+
</smtx:XamlDisplay>
62+
63+
<smtx:XamlDisplay
64+
UniqueKey="shadow_9"
65+
Margin="0 0 16 32">
66+
<Button
67+
Style="{StaticResource MaterialDesignFloatingActionMiniButton}"
68+
materialDesign:ElevationAssist.Elevation="Dp0"
69+
Content="0"/>
70+
</smtx:XamlDisplay>
71+
72+
<smtx:XamlDisplay
73+
UniqueKey="shadow_10"
74+
Margin="0 0 16 32">
75+
<Button
76+
Style="{StaticResource MaterialDesignFloatingActionMiniButton}"
77+
materialDesign:ElevationAssist.Elevation="Dp2"
78+
Content="2"/>
79+
</smtx:XamlDisplay>
80+
81+
<smtx:XamlDisplay
82+
UniqueKey="shadow_11"
83+
Margin="0 0 16 32">
84+
<Button
85+
Style="{StaticResource MaterialDesignFloatingActionMiniButton}"
86+
Content="6"/>
87+
</smtx:XamlDisplay>
88+
89+
<smtx:XamlDisplay
90+
UniqueKey="shadow_12"
91+
Margin="0 0 16 32">
92+
<Button
93+
Style="{StaticResource MaterialDesignFloatingActionMiniButton}"
94+
materialDesign:ElevationAssist.Elevation="Dp12"
95+
Content="12"/>
96+
</smtx:XamlDisplay>
97+
98+
<smtx:XamlDisplay
99+
UniqueKey="shadow_13"
100+
Margin="0 0 16 32">
101+
<Button
102+
Style="{StaticResource MaterialDesignFloatingActionMiniButton}"
103+
materialDesign:ElevationAssist.Elevation="Dp16"
104+
Content="16"/>
105+
</smtx:XamlDisplay>
106+
</WrapPanel>
107+
108+
<WrapPanel
109+
Orientation="Horizontal"
110+
Margin="0 12 0 0">
111+
<WrapPanel.Resources>
112+
<Style TargetType="{x:Type materialDesign:Card}" BasedOn="{StaticResource {x:Type materialDesign:Card}}">
113+
<Setter Property="Width" Value="150" />
114+
<Setter Property="Height" Value="80" />
115+
<Setter Property="HorizontalContentAlignment" Value="Center" />
116+
<Setter Property="VerticalContentAlignment" Value="Center" />
117+
</Style>
118+
</WrapPanel.Resources>
119+
<smtx:XamlDisplay UniqueKey="elevation_card_level0" Margin="0,0,16,32">
120+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp0" Content="0 dp" />
121+
</smtx:XamlDisplay>
122+
<smtx:XamlDisplay UniqueKey="elevation_card_level1" Margin="0,0,16,32">
123+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp1" Content="1 dp" />
124+
</smtx:XamlDisplay>
125+
<smtx:XamlDisplay UniqueKey="elevation_card_level2" Margin="0,0,16,32">
126+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp2" Content="2 dp" />
127+
</smtx:XamlDisplay>
128+
<smtx:XamlDisplay UniqueKey="elevation_card_level3" Margin="0,0,16,32">
129+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp3" Content="3 dp" />
130+
</smtx:XamlDisplay>
131+
<smtx:XamlDisplay UniqueKey="elevation_card_level4" Margin="0,0,16,32">
132+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp4" Content="4 dp" />
133+
</smtx:XamlDisplay>
134+
<smtx:XamlDisplay UniqueKey="elevation_card_level5" Margin="0,0,16,32">
135+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp5" Content="5 dp" />
136+
</smtx:XamlDisplay>
137+
<smtx:XamlDisplay UniqueKey="elevation_card_level6" Margin="0,0,16,32">
138+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp6" Content="6 dp" />
139+
</smtx:XamlDisplay>
140+
<smtx:XamlDisplay UniqueKey="elevation_card_level7" Margin="0,0,16,32">
141+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp7" Content="7 dp" />
142+
</smtx:XamlDisplay>
143+
<smtx:XamlDisplay UniqueKey="elevation_card_level8" Margin="0,0,16,32">
144+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp8" Content="8 dp" />
145+
</smtx:XamlDisplay>
146+
<smtx:XamlDisplay UniqueKey="elevation_card_level12" Margin="0,0,16,32">
147+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp12" Content="12 dp" />
148+
</smtx:XamlDisplay>
149+
<smtx:XamlDisplay UniqueKey="elevation_card_level16" Margin="0,0,16,32">
150+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp16" Content="16 dp" />
151+
</smtx:XamlDisplay>
152+
<smtx:XamlDisplay UniqueKey="elevation_card_level24" Margin="0,0,16,32">
153+
<materialDesign:Card materialDesign:ElevationAssist.Elevation="Dp24" Content="24 dp" />
154+
</smtx:XamlDisplay>
155+
</WrapPanel>
156+
157+
<WrapPanel
158+
Orientation="Horizontal"
159+
Margin="0 12 0 0">
160+
<WrapPanel.Resources>
161+
<Style TargetType="TextBlock">
162+
<Setter Property="TextAlignment" Value="Center" />
163+
<Setter Property="LineHeight" Value="20" />
164+
<Setter Property="LineStackingStrategy" Value="BlockLineHeight" />
165+
</Style>
166+
<Style TargetType="{x:Type materialDesign:Card}" BasedOn="{StaticResource {x:Type materialDesign:Card}}">
167+
<Setter Property="Width" Value="150" />
168+
<Setter Property="Height" Value="80" />
169+
<Setter Property="VerticalContentAlignment" Value="Center" />
170+
<Setter Property="UseLayoutRounding" Value="True" />
171+
<Setter Property="UniformCornerRadius" Value="0" />
172+
<Setter Property="materialDesign:ElevationAssist.Elevation" Value="Dp16" />
173+
</Style>
174+
</WrapPanel.Resources>
175+
<smtx:XamlDisplay UniqueKey="shadow_26" Margin="0 0 16 32">
176+
<materialDesign:Card materialDesign:ShadowAssist.ShadowEdges="Bottom,Right">
177+
<TextBlock Text="Custom shadow clip&#10;Bottom, Right" />
178+
</materialDesign:Card>
179+
</smtx:XamlDisplay>
180+
<smtx:XamlDisplay UniqueKey="shadow_27" Margin="0 0 16 32">
181+
<materialDesign:Card materialDesign:ShadowAssist.ShadowEdges="Top">
182+
<TextBlock Text="Custom shadow clip&#10;Top" />
183+
</materialDesign:Card>
184+
</smtx:XamlDisplay>
185+
<smtx:XamlDisplay UniqueKey="shadow_28" Margin="0 0 16 32">
186+
<materialDesign:Card materialDesign:ShadowAssist.ShadowEdges="Bottom,Left">
187+
<TextBlock Text="Custom shadow clip&#10;Bottom, Left" />
188+
</materialDesign:Card>
189+
</smtx:XamlDisplay>
190+
</WrapPanel>
191+
192+
</StackPanel>
193+
</UserControl>

MainDemo.Wpf/Elevation.xaml.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
namespace MaterialDesignDemo
2+
{
3+
public partial class Elevation
4+
{
5+
public Elevation() => InitializeComponent();
6+
}
7+
}

MainDemo.Wpf/GroupBoxes.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@
4949
Header="Shadow Header"
5050
Style="{StaticResource MaterialDesignGroupBox}"
5151
Margin="16"
52-
materialDesign:ShadowAssist.ShadowDepth="Depth3"
52+
materialDesign:ElevationAssist.Elevation="Dp6"
5353
BorderThickness="0">
5454
<TextBlock
5555
Margin="6,6,6,6"

0 commit comments

Comments
 (0)