I want to change cursor style when mouse is over the WPF TextBlock.
<Style TargetType="{x:Type TextBlock}" x:Key="HoverBox">
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Foreground" Value="Yellow" />
<Setter Property="Cursor" Value="Hand" />
</Trigger>
</Style.Triggers>
</Style>
The problem is that <Setter Property="Cursor" Value="Hand" /> doesn’t work.
But this Setter works fine <Setter Property="Foreground" Value="Yellow" />
Also I need to use underlying font style. How I can do it?
Thanks!!
Maybe you have a precedence problem? e.g. when you set the cursor on the styled control the trigger will not have enough precedence to change the value.
(If i apply this style to a
TextBlockwhich only has itsTextset it works just fine)