Materialdesigninxamltoolkit: Request: Outline button style

Created on 19 Oct 2018  路  3Comments  路  Source: MaterialDesignInXAML/MaterialDesignInXamlToolkit

I would like a new style for a flat button with an outline. This style is described in the official guidelines.

Suggested style name MaterialDesignOutlinedButton

Reference

https://material.io/design/components/buttons.html#outlined-button

enhancement

Most helpful comment

Turns out this is all that needs to be added if we're OK with everything else being same as a flat button. It is not entirely in line with the specs. For that we probably need to modify the control template.

<Style x:Key="MaterialDesignOutlinedFlatButton" TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignFlatButton}">
     <Setter Property="BorderThickness" Value="1"/>
     <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignFlatButtonClick}"/>
</Style>

outlinedbutton

All 3 comments

Turns out this is all that needs to be added if we're OK with everything else being same as a flat button. It is not entirely in line with the specs. For that we probably need to modify the control template.

<Style x:Key="MaterialDesignOutlinedFlatButton" TargetType="{x:Type Button}" BasedOn="{StaticResource MaterialDesignFlatButton}">
     <Setter Property="BorderThickness" Value="1"/>
     <Setter Property="BorderBrush" Value="{DynamicResource MaterialDesignFlatButtonClick}"/>
</Style>

outlinedbutton

@mgnslndh That looks like a pretty good start. It does look like the spec calls for the ripple to follow the primary color.
image

This may be as simple as adding (would need to test to see which):

<Setter Property="wpf:RippleAssist.Feedback" Value="{DynamicResource PrimaryHueMidBrush}" />
<!-- or -->
<Setter Property="wpf:RippleAssist.Feedback" Value="{DynamicResource PrimaryHueLightBrush}" />

Those outline buttons look slick. The corners of the ones in the spec are a tiny bit more rounded however. CornerRadius 3 or 4.
image

Was this page helpful?
0 / 5 - 0 ratings