开发者

ControlTemplate with "Control.IsMouseOver" Value="True" and "Control.IsMouseOver" Value="False">

In my WPF control, I have below code. If I don't have a trigger with false, I can see the my storyboard, but if I have both ture and false trigger开发者_如何学Gos, I don't see any thing.

How to fix this? Appreciate your help!

<Trigger Property="Control.IsMouseOver" Value="True">
 <StoryBoard>          
      Image with Opacity 1
 </StoryBoard>
</Trigger>        
<Trigger Property="Control.IsMouseOver" Value="False">
 <StoryBoard> 
      Image with Opacity 0
 </StoryBoard>
</Trigger>        


False trigger is unnecessary. Use default control state to represent situation when Control.IsMouseOver is False. WPF automatically reverts changes made by trigger when its condition is false.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜