Skip to content

Commit 6a7bf0c

Browse files
authored
1 parent daf205d commit 6a7bf0c

File tree

3 files changed

+14
-13
lines changed

3 files changed

+14
-13
lines changed

MainDemo.Wpf/Snackbars.xaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -178,7 +178,7 @@
178178
<materialDesign:Snackbar IsActive="True"
179179
ActionButtonStyle="{StaticResource MaterialDesignSnackbarActionMidButton}"
180180
ActionButtonPlacement="Inline">
181-
<materialDesign:SnackbarMessage Content="Primary Mid" ActionContent="MID" />
181+
<materialDesign:SnackbarMessage Content="Primary Mid - Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua." ActionContent="MID" />
182182
</materialDesign:Snackbar>
183183
</smtx:XamlDisplay>
184184
<smtx:XamlDisplay Key="snackbar_9" Margin="0 8 0 0">

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Snackbar.xaml

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,9 @@
2626
<Setter Property="BorderThickness" Value="1" />
2727
<Setter Property="HorizontalContentAlignment" Value="Center" />
2828
<Setter Property="VerticalContentAlignment" Value="Center" />
29-
<Setter Property="Padding" Value="24 0 24 0" />
30-
<Setter Property="Margin" Value="24 -14 -24 -14" />
29+
<Setter Property="Height" Value="36" />
30+
<Setter Property="Margin" Value="8 -10 -8 -10" />
31+
<Setter Property="Padding" Value="8" />
3132
<Setter Property="Template">
3233
<Setter.Value>
3334
<ControlTemplate TargetType="{x:Type Button}">
@@ -46,8 +47,7 @@
4647
<Setter Property="Opacity" Value="0.23" />
4748
</Trigger>
4849
<Trigger Property="DockPanel.Dock" Value="Bottom">
49-
<Setter Property="Margin" Value="24 0 -24 -14" />
50-
<Setter Property="Padding" Value="24 8 24 8" />
50+
<Setter Property="Margin" Value="0 18 -8 -8" />
5151
</Trigger>
5252
</ControlTemplate.Triggers>
5353
</ControlTemplate>
@@ -69,10 +69,11 @@
6969

7070
<Style TargetType="wpf:SnackbarMessage">
7171
<Setter Property="HorizontalContentAlignment" Value="Left" />
72+
<Setter Property="Margin" Value="16" />
7273
<Setter Property="Template">
7374
<Setter.Value>
7475
<ControlTemplate TargetType="wpf:SnackbarMessage">
75-
<DockPanel MaxHeight="{Binding RelativeSource={RelativeSource AncestorType={x:Type wpf:Snackbar}}, Path=(wpf:SnackbarMessage.ContentMaxHeight)}">
76+
<DockPanel>
7677
<!-- will become a Panel to wrap a "pretend" button -->
7778
<Button x:Name="PART_ActionButton"
7879
Command="{TemplateBinding ActionCommand}"
@@ -98,10 +99,11 @@
9899
ContentTemplate="{TemplateBinding ContentTemplate}"
99100
ContentStringFormat="{TemplateBinding ContentStringFormat}"
100101
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
101-
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
102+
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
103+
MaxHeight="{Binding RelativeSource={RelativeSource AncestorType={x:Type wpf:Snackbar}}, Path=(wpf:SnackbarMessage.ContentMaxHeight)}">
102104
<ContentPresenter.Resources>
103105
<DataTemplate DataType="{x:Type system:String}">
104-
<TextBlock Text="{Binding}">
106+
<TextBlock Text="{Binding}" Padding="0">
105107
<TextBlock.Style>
106108
<Style TargetType="{x:Type TextBlock}" BasedOn="{StaticResource MaterialDesignBody1TextBlock}">
107109
<Setter Property="FontSize" Value="14" />
@@ -129,10 +131,9 @@
129131
<Setter Property="ActionButtonStyle" Value="{StaticResource MaterialDesignSnackbarActionButton}" />
130132
<Setter Property="MinWidth" Value="288" />
131133
<Setter Property="MaxWidth" Value="568" />
132-
<Setter Property="Padding" Value="24 14 24 14" />
133134
<Setter Property="ClipToBounds" Value="True" />
134-
<Setter Property="wpf:SnackbarMessage.InlineActionButtonMaxHeight" Value="53" />
135-
<Setter Property="wpf:SnackbarMessage.ContentMaxHeight" Value="61" />
135+
<Setter Property="wpf:SnackbarMessage.InlineActionButtonMaxHeight" Value="49" />
136+
<Setter Property="wpf:SnackbarMessage.ContentMaxHeight" Value="36" />
136137
<Setter Property="Template">
137138
<Setter.Value>
138139
<ControlTemplate TargetType="wpf:Snackbar">
@@ -170,9 +171,9 @@
170171
</MultiBinding>
171172
</StackPanel.Height>
172173
<Border x:Name="ContentBorder"
173-
Background="{TemplateBinding Background}" CornerRadius="2" SnapsToDevicePixels="True"
174+
Background="{TemplateBinding Background}" CornerRadius="3" SnapsToDevicePixels="True"
174175
VerticalAlignment="Stretch"
175-
MinHeight="24">
176+
MinHeight="48">
176177
<ContentPresenter Content="{TemplateBinding Message}"
177178
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
178179
Margin="{TemplateBinding Padding}"

web/images/screen-snackbars.png

43.3 KB
Loading

0 commit comments

Comments
 (0)