After the WPF animation execution attributes can not be modified

Original: After the implementation of WPF animation properties can not be modified

In doing a similar QQ expanded animation, set TopProperty, by changing Window.Top property Expand effects,

However, after the implementation of the animation, go to Settings Window.Top it was found not to modify, after debugging the code found value, but is still the original value.

 

The WPF animation to design a property kidnapping, are explained in MSDN: https://msdn.microsoft.com/zh-cn/library/aa970493(v=VS.100).aspx

 

In some cases, after the animated properties, it can not seem to change the value of the property.

 

The above code does not seem to play any role: Brush remains yellow, that animate the brush ColorAnimation value provided. Base attribute value (base value) actually changed to blue. However, because ColorAnimation still override the base value, the effective value (or current value) remains yellow. If you need to base value again becomes valid value, it must prohibit the animation affect the property. Use storyboard animation, there are three ways to achieve this goal:

  • The animated FillBehavior property to Stop

  • Remove the entire storyboard.

  • Remove the animation from a single property.

 

Each method gave a detailed explanation and usage.

Of course, for me, the easiest way is to first, get a code!

 

 

MSDN Library catalog: https://msdn.microsoft.com/zh-cn/library/ms310241

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/lonelyxmas/p/12208804.html