|
| 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 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 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 Bottom, Left" /> |
| 188 | + </materialDesign:Card> |
| 189 | + </smtx:XamlDisplay> |
| 190 | + </WrapPanel> |
| 191 | + |
| 192 | + </StackPanel> |
| 193 | +</UserControl> |
0 commit comments