views:

291

answers:

1

Hi there,

I'm struggling with a binding that only works when declared inside a Window's resources area. As soon as I move the declaration to a UserControl's resources area, the binding fails. No error message, but the value is not updated when the value of the slider (source) is changed. I would like to use the storyboard inside one of the UserControl's VSM states.

Can someone please tell me why this happens and hopefully how to fix it?

I tried pasting my xaml here, but the website doesn't seam to allow the xml tags in the message.

Regards

Jaco

A: 

Only set the Storyboard.TargetProperty (and not .Target or .TargetName) and point the storyboard to the object in code:

Dim SB as Storyboard = Me.FindResource("Storyboard_name_goes_here")
TargetObject.BeginStoryboard(SB, HandoffBehavior.Compose)

Hope this helps...

Yes, this i a very good suggestion. However I would like to use the storyboard inside a VSM state. So I want the VSM to initiate the storyboard as a transition, not invoke it manually from code behind.