I would like to create a Rounded Button by using ControlTemplate. This is my code and it works perfectly when my width and height are equal to 30. May I know, is it possible to set the RadiusX and RadiusY equal to the half of button Width
(e.g. RadiusX={Width/2})?
<ControlTemplate x:Key="RoundButton" TargetType="Button">
<Grid>
<Rectangle RadiusX="15" RadiusY="15"
Width="{TemplateBinding Width}" Height="{TemplateBinding Height}"
Fill="{TemplateBinding Background}" />
<ContentPresenter Margin="3"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>