views:

71

answers:

1

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 triggers, 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>        
+2  A: 

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.

levanovd
Levanovd, I tried with Property="Control.IsMouseOver" Value="True". But it doesn't revert the storyboard. Can you please tell me which default state should I use?
Vin
Are you shure that you need Storyboard? Maybe Setter is enough to set opacity to image?
levanovd