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 TextBlock which only has its Text set it works just fine)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With