WPF MVVM Property Change Animation

Posted by cjibo on Stack Overflow See other posts from Stack Overflow or by cjibo
Published on 2009-10-30T13:31:59Z Indexed on 2010/05/25 6:51 UTC
Read the original article Hit count: 281

Filed under:
|
|

I am looking for a clean way to start an animation that will have dynamic values. Basically I want to do an animation where an element changes width based on the data of another element. Say I have a TextBlock that's Text Property is Binding. When this property changes I want a visual element say a Rectangle for our sake to do a DoubleAnimation changing the width from previous value to the new value.

I am trying to stay away from putting code in my view if possible. I've looked into DataTriggers but they seem to require that you know what the value would be such as an Enum. In my case it is just the value changing that needs to trigger a storyboard and the animation would need to start at the current(previous) value and move nicely to the new value.

Any ideas. Maybe I just missed a property.

© Stack Overflow or respective owner

Related posts about wpf

Related posts about animation