I have a WPF app with a Rectangle trigger defined as:
<Style TargetType="{x:Type Rectangle}">
<Setter Property="Rectangle.StrokeThickness" Value="1"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Rectangle.StrokeThickness" Value="4"/>
</Trigger>
</Style.Triggers>
</Style>
And a Rectangle as:
<Rectangle Fill="Blue" StrokeThickness="2" Stroke="Black" Height="20" Width="50" />
Rectangle doesn't change strokethickness when mouse is over. Why not?
From stackoverflow
-
Remove the StrokeThickness="2" from your Rectangle object and it should work..
You are overriding the StrokeThickness style when you set the property directly on the Rectangle...
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.