Skip to content

Commit 92991cc

Browse files
committed
refactor: leverage ClipToBounds instead of a custom converter
Set ClipToBounds="True" instead of using the `BorderClipConverter` in the Button ControlTemplate to prevent child elements from rendering outside the template boundaries.
1 parent 77e135d commit 92991cc

File tree

1 file changed

+2
-9
lines changed

1 file changed

+2
-9
lines changed

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

Lines changed: 2 additions & 9 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 x:Name="rootGrid">
20+
<Grid ClipToBounds="True">
2121
<VisualStateManager.VisualStateGroups>
2222
<VisualStateGroup Name="CommonStates">
2323
<VisualStateGroup.Transitions>
@@ -57,14 +57,7 @@
5757
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
5858
Feedback="{TemplateBinding Foreground, Converter={x:Static converters:BrushRoundConverter.Instance}}"
5959
Focusable="False"
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>
60+
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" />
6861
</Grid>
6962
</ControlTemplate>
7063
</Setter.Value>

0 commit comments

Comments
 (0)