Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ShakeAnimation with RepeatForever and Triggers #14

Open
matteopiccioni opened this issue Sep 3, 2019 · 1 comment
Open

ShakeAnimation with RepeatForever and Triggers #14

matteopiccioni opened this issue Sep 3, 2019 · 1 comment
Assignees
Labels

Comments

@matteopiccioni
Copy link

matteopiccioni commented Sep 3, 2019

Hello,
I try to use ShakeAnimation with repeatForever and Trigger in this way

<Label x:Name="AllarmeBox" Text="text to show" FontSize="Large" IsVisible="{Binding IsLabelVisible}"
                   HorizontalTextAlignment="Center" VerticalTextAlignment="Center">

                <Label.Triggers>

                        <Trigger TargetType="Label" Property="IsVisible" Value="True">
                            <Trigger.EnterActions>
                                <xamanimation:BeginAnimation Animation="{StaticResource ShakeAnimationIn}" />
                            </Trigger.EnterActions>
                            <Trigger.ExitActions>
                                <xamanimation:BeginAnimation Animation="{StaticResource ShakeAnimationOut}" />
                            </Trigger.ExitActions>
                        </Trigger>

                </Label.Triggers>
            </Label>

having in the resources:

            <xamanimation:ShakeAnimation
                x:Key="ShakeAnimationIn"
                RepeatForever="True"
                Target="{x:Reference AllarmeBox}"/>

            <xamanimation:ShakeAnimation
                x:Key="ShakeAnimationOut"
                Target="{x:Reference AllarmeBox}"/>

The problem is that using RepeatForever="True" the label is not shown...
maybe multiple shake animation starts on the same label, without waiting the previous animation ends?

ps
Using only ShakeAnimationOut (without RepeatForever) the single animation is shown

Update:
In your sample, if you add RepeatForever="True" on ShakeAnimation, you can see the box moving out of screen
Maybe the 'next animation' should starts after the animation previous animation ends ('Duration' parameter)

Thanks

@jsuarezruiz jsuarezruiz self-assigned this Sep 3, 2019
@jsuarezruiz jsuarezruiz added the bug label Sep 3, 2019
@munkii
Copy link

munkii commented May 15, 2020

I am currently trying to use a HeartAnimation with RepeatForever and a DataTrigger. When I add RepeatForever the animation never starts.

If i do not use Repeat Forever the animation does start but of course that's no good as I want it to run until the DataTrigger is negated

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants