Skip to content

Commit 77e135d

Browse files
committed
fix: Clip ripple effect for default Button style in materialDesign:PopupBox
Use the BorderClipConverter to clip the ripple to the bounds of the button
1 parent c87d8f8 commit 77e135d

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/MaterialDesignThemes.Wpf/Themes/MaterialDesignTheme.PopupBox.xaml

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@
1717
<Setter Property="Template">
1818
<Setter.Value>
1919
<ControlTemplate TargetType="{x:Type Button}">
20-
<Grid>
20+
<Grid x:Name="rootGrid">
2121
<VisualStateManager.VisualStateGroups>
2222
<VisualStateGroup Name="CommonStates">
2323
<VisualStateGroup.Transitions>
@@ -57,7 +57,14 @@
5757
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
5858
Feedback="{TemplateBinding Foreground, Converter={x:Static converters:BrushRoundConverter.Instance}}"
5959
Focusable="False"
60-
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
60+
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" >
61+
<wpf:Ripple.Clip>
62+
<MultiBinding Converter="{x:Static converters:BorderClipConverter.Instance}">
63+
<Binding ElementName="rootGrid" Path="ActualWidth" />
64+
<Binding ElementName="rootGrid" Path="ActualHeight" />
65+
</MultiBinding>
66+
</wpf:Ripple.Clip>
67+
</wpf:Ripple>
6168
</Grid>
6269
</ControlTemplate>
6370
</Setter.Value>

0 commit comments

Comments
 (0)