Replies: 1 comment 4 replies
-
I would expect some property in the view model that defines if last login was failed, and update class with its value. Without timers or something. As an alternative way you can move all setters to the Animation instance, and store it in the resources, in same way as you store Storyboard in the UWP. Later you can run this animation in following way |
Beta Was this translation helpful? Give feedback.
4 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
I'm porting an app from WinUI to Avalonia and I'm having some trouble to port animations.
On WinUI I have an animation that is triggered when login fails and makes the two TextBox and the Button red for an half of second and then reverts to its original state:
I just trigger it from code using LoginFailedAnimation.Begin().
On Avalonia I have something like this:
At the moment, in order to trigger the animation I change the Classes property of the two TextBox and of the Button from code, by the way at the end of the animation I have to change back the Classes property to the original style. In order to do so, I have to use a timer that waits 1 sec and then revert the Classes property, by the way I think it is a poor approach.
Is there something better to achieve this behaviour? Am I missing something obvious?
Beta Was this translation helpful? Give feedback.
All reactions