<Style x:Key="MyButton" TargetType="{x:Type Border}">
<Style.Resources>
<Style TargetType="{x:Type TextBlock}">
<Setter Property="FontSize" Value="24"/>
<Setter Property="Foreground" Value="{StaticResource FontColor}"/>
<Setter Property="HorizontalAlignment" Value="Center"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="FontWeight" Value="DemiBold" />
<Setter Property="Effect">
<Setter.Value>
<BlurEffect Radius="2" ></BlurEffect>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="FontWeight" Value="ExtraBold" />
</Trigger>
</Style.Triggers>
</Style>
</Style.Resources>
</Style>
I want to create my own button style that consist of a border and a textblock. How can I add a control to my style? I actually want to add an extra textblock so that I can blur the textbox that is in the back making it look like a glow.
I’m not sure exactly how you want your second blur textblock to look, but the following xaml should get you well on your way to creating the button template you’re after.
Each textblock, as well as the border, have their own styles so you can style them individually and wrap them all up inside the control template of your button style: