<ContentPresenter
HorizontalAlignment="{TemplateBinding
HorizontalContentAlignment}"
RecognizesAccessKey="True"
SnapsToDevicePixels="{TemplateBinding
SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding
VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid
x:Name="LayoutRoot">
<Button
Content="Button"
Foreground
="White"
HorizontalAlignment="Center"
Height="40"
Margin="0" Style="{DynamicResource
ButtonStyle1}"
VerticalAlignment="Center"
Width="100" Name="Button1"
/>
</Grid>
</UserControl>
Note: Don't Copy the code from
here. Download the file attached herewith.
The above code generate the
following button, as shown in below image:

Join the conversation! Your thoughts help the community grow.