Skip to content

Commit cf1e8a0

Browse files
authored
Added some tolerance to InlineActionButtonMaxHeight (#1820)
* Changed InlineActionButtonMaxHeight to 55 (#1812) * Set default value of InlineActionButtonMaxHeight and ContentMaxHeight to their only usage, added documentation (#1812)
1 parent af2ecd7 commit cf1e8a0

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

MaterialDesignThemes.Wpf/SnackbarMessage.cs

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,14 +120,21 @@ private void ButtonBaseOnClick(object sender, RoutedEventArgs routedEventArgs)
120120
OnActionClick();
121121
}
122122

123+
/// <summary>
124+
/// Maximum total height of snackbar for the action button to be inlined.
125+
/// <para>
126+
/// Default value (<c>55</c>) is between single line message (<c>48</c>) and two lined snackbar-message (<c>66</c>)
127+
/// because tolerance is required (see <a href="https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/issues/1812">issue</a>)
128+
/// </para>
129+
/// </summary>
123130
public static readonly DependencyProperty InlineActionButtonMaxHeightProperty = DependencyProperty.RegisterAttached(
124-
"InlineActionButtonMaxHeight", typeof(double), typeof(SnackbarMessage), new PropertyMetadata(default(double)));
131+
"InlineActionButtonMaxHeight", typeof(double), typeof(SnackbarMessage), new PropertyMetadata(55d));
125132

126133
public static void SetInlineActionButtonMaxHeight(DependencyObject element, double value) => element.SetValue(InlineActionButtonMaxHeightProperty, value);
127134
public static double GetInlineActionButtonMaxHeight(DependencyObject element) => (double) element.GetValue(InlineActionButtonMaxHeightProperty);
128135

129136
public static readonly DependencyProperty ContentMaxHeightProperty = DependencyProperty.RegisterAttached(
130-
"ContentMaxHeight", typeof(double), typeof(SnackbarMessage), new PropertyMetadata(default(double)));
137+
"ContentMaxHeight", typeof(double), typeof(SnackbarMessage), new PropertyMetadata(36d));
131138

132139
public static void SetContentMaxHeight(DependencyObject element, double value) => element.SetValue(ContentMaxHeightProperty, value);
133140
public static double GetContentMaxHeight(DependencyObject element) => (double) element.GetValue(ContentMaxHeightProperty);

MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.Snackbar.xaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -132,8 +132,6 @@
132132
<Setter Property="MinWidth" Value="288" />
133133
<Setter Property="MaxWidth" Value="568" />
134134
<Setter Property="ClipToBounds" Value="True" />
135-
<Setter Property="wpf:SnackbarMessage.InlineActionButtonMaxHeight" Value="49" />
136-
<Setter Property="wpf:SnackbarMessage.ContentMaxHeight" Value="36" />
137135
<Setter Property="Template">
138136
<Setter.Value>
139137
<ControlTemplate TargetType="wpf:Snackbar">

0 commit comments

Comments
 (0)