Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

WPF Animation Duration

Tags:

wpf

storyboard

I have a storyboard like the following

Duration="0:0:1" Completed="DeviceExplorer_Completed">

The animation for some reason does not appear to be working linearly. If I change the duration to something like Duration="0:0:0.8"

and assign the stroyboard to a MouseEnter event of a button, the animation moves but does not complete for some reason, I move my mouse over the button a few times before it enetually completes...

Any ideas why?

like image 658
TheWommies Avatar asked Nov 15 '25 19:11

TheWommies


1 Answers

You have to set the duration on the animation and not the storyboard. The animation will default to a duration of 1 second if not set and the storyboard is ending in less time than that so the animation gets cut short by whatever length of time is the difference. When you put the duration on the animation it should work fine.

like image 151
LIZA Roberts Avatar answered Nov 17 '25 19:11

LIZA Roberts



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!