I have this animation:
<DataTrigger Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=IsVisible}" Value="True">
<DataTrigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<Storyboard x:Name="myStoryboard">
<DoubleAnimation From="15" To="85" Duration="00:00:0.7" Storyboard.TargetProperty="Height">
<DoubleAnimation.EasingFunction>
<BounceEase Bounces="2" EasingMode="EaseOut" Bounciness="5" />
</DoubleAnimation.EasingFunction>
</DoubleAnimation>
</Storyboard>
</Storyboard>
</BeginStoryboard>
</DataTrigger.EnterActions>
</DataTrigger>
Which will trigger when my StackPanel
is visible. My problem is to create the reverse animation, when to stackpanel changes it's visibility to Collapsed. I've tried with the ExitActions
inside the DataTrigger
I've also tried by creating a new DataTrigger
which sets the binding to Binding="{Binding RelativeSource={x:Static RelativeSource.Self}, Path=IsVisible}" Value="False"
But none of these attemps gave me the correct reverse animation. Any suggestions?