How to unify WPF DependencyProperty?

After starting WPF animation on the dependency properties in the code behind, the dependency properties can no longer be set using SetValue. They can only be changed through animation.

I want to change the dependency property, several times using short animations, sometimes right away in the code.

So, how can I remove the animation from the dependency property after the animation has reached its end?

+3
source share
2 answers

After the animation finishes (or when you want to stop it):

myButton.Width = myButton.Width; // set current value to the end value of the animation
myButton.ApplyAnimationClock(Button.WidthProperty, null); // remove animation

For a library that makes it easy to take a look at http://code.google.com/p/wpf-animation/

+4

FillBehaviour . BeginAnimation. .

, , .

+5

Source: https://habr.com/ru/post/1725004/


All Articles