<Style x:Key="{x:Type Hyperlink}" TargetType="{x:Type Hyperlink}">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="true">
<Setter Property="Foreground" Value="Red" />
</Trigger>
<Trigger Property="IsEnabled" Value="false">
<Setter Property="Foreground"
Value="{DynamicResource {x:Static GrayTextBrush}}" />
</Trigger>
<Trigger Property="IsEnabled" Value="true">
<Setter Property="Cursor" Value="Hand" />
</Trigger>
</Style.Triggers>
<Setter Property="Foreground" Value="Blue" />
<Setter Property="TextDecorations" Value="Underline" />
</Style>
Oh, a slight surprise for me was that the hyperlink colors are not bound to any SystemColor members. No, they are just Red and Blue nailed in the style. Why?....
Showing posts with label Hyperlink. Show all posts
Showing posts with label Hyperlink. Show all posts
Wednesday, December 1, 2010
WPF Hyperlink default style
Tried to find the default style of a Hyperlink and discovered that neither Google, nor Expression Blend or ShowMeTheTemplate have it. So I had to disassemble WPF assembly with .NET Reflector+BAML viewer. Here is the style for Aero NormalColor theme, just for reference purposes:
Subscribe to:
Posts (Atom)