For simple setters, we always use <Setter Property=”[property_name]” Value=”[property_value]”>. However, when the property is a complex type, I was blocked for a good 30 mins until i figured out the correct syntax. Hence, i wanted to share in case someone also encounters similar problem.
For a complex property like “TextDecoration”, the way to set it in style would be :
<TextDecoration Location=”Underline” >
<Pen Brush=”Red” />
So here we set the textdecoration property in XAML, via Setter.Value element. Within this element, again we have TextDecoration.Pen object which is set using its own element. This is how we can set complex types in Setters.