views:

147

answers:

2

Let's say that I have this storyboard:

<Storyboard x:Key="OnMouseEnterStoryboard">
                    <DoubleAnimation BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" To="180" />
            </Storyboard>

It's there a possibility that I can set the To property from code. Something like

DoubleAnimation BeginTime="00:00:00" Storyboard.TargetProperty="(UIElement.RenderTransform).(RotateTransform.Angle)" To="{Binding angle}" />

And when I want to apply this animation to have a possibility to set it?

A: 

Storyboards can have bindings, just like anything else - instead of trying to dig through and set this explicitly, bind it to something easier to get ahold of like the Window object or a ViewModel

Paul Betts
Could you give me an example. I really don't understand your idea. I'm a beginner in WFP
Alin
+1  A: 

I completely agree with what @Paul said : Storyboard property bindings are no different from "normal" way of binding properties.

Anyway, this, this, this, this, and this are the links that you should follow if you want some good examples on Storyboard and Animation with property binding.


Mihir Gokani