Windows Vista Forums
Vista Forums Home Join Vista Forums Windows 7 Forum Vista Tutorials Tags
Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks.

Go Back   Vista Forums > Misc Newsgroups > Avalon

Vista - Databound animation

 
 
Old 05-03-2006   #1 (permalink)
Joao Paulo Duque Vieira


 
 

Databound animation

I have a custom control that exposes a Dependency Property called Angle and
an Event called AngleChanged.
I've tryed to set an Event Trigger on AngleChanged in a Style for this control
that animates a Path by Rotating it the Angle amount.

But, when I set the To property of the DoubleAnimation (TargetProperty=Angle)
rotation to a Binding to the Angle Dependency Property,

<DoubleAnimation Storyboard.TargetName="Hand"
Storyboard.TargetProperty="(RotateTransform.Angle)"
To="{Binding Path=Angle, RelativeSource={RelativeSource
TemplatedParent}}"
Duration="0:0:1" />


I get the following runtime error:

"This Storyboard timeline tree could not be frozen. Please remove thread-bound
values such as bindings or dynamic resource references."

Any ideas?
If I set the Angle rotation to an absolute value in the animation (To="10")
it works fine.

Thanks.



My System SpecsSystem Spec
Old 05-03-2006   #2 (permalink)
Pascal Bourque


 
 

Re: Databound animation

You could try setting the Mode of the Binding to OneTime or OneWay:

To="{Binding Path=Angle,Mode=OneTime,...}"

I'm not quite sure if it would make a difference, but it might be worth
trying...


Pascal

Joao Paulo Duque Vieira wrote:
> I have a custom control that exposes a Dependency Property called Angle
> and an Event called AngleChanged.
> I've tryed to set an Event Trigger on AngleChanged in a Style for this
> control that animates a Path by Rotating it the Angle amount.
>
> But, when I set the To property of the DoubleAnimation
> (TargetProperty=Angle) rotation to a Binding to the Angle Dependency
> Property,
> <DoubleAnimation Storyboard.TargetName="Hand"
> Storyboard.TargetProperty="(RotateTransform.Angle)"
> To="{Binding Path=Angle,
> RelativeSource={RelativeSource TemplatedParent}}"
> Duration="0:0:1" />
>
>
> I get the following runtime error:
>
> "This Storyboard timeline tree could not be frozen. Please remove
> thread-bound values such as bindings or dynamic resource references."
>
> Any ideas?
> If I set the Angle rotation to an absolute value in the animation
> (To="10") it works fine.
>
> Thanks.
>

My System SpecsSystem Spec
Old 05-03-2006   #3 (permalink)
Joao Paulo Duque Vieira


 
 

Re: Databound animation

Hello Pascal,

Thanks, but the result is the same.



> You could try setting the Mode of the Binding to OneTime or OneWay:
>
> To="{Binding Path=Angle,Mode=OneTime,...}"
>
> I'm not quite sure if it would make a difference, but it might be
> worth trying...
>
> Pascal
>
> Joao Paulo Duque Vieira wrote:
>
>> I have a custom control that exposes a Dependency Property called
>> Angle
>> and an Event called AngleChanged.
>> I've tryed to set an Event Trigger on AngleChanged in a Style for
>> this
>> control that animates a Path by Rotating it the Angle amount.
>> But, when I set the To property of the DoubleAnimation
>> (TargetProperty=Angle) rotation to a Binding to the Angle Dependency
>> Property,
>> <DoubleAnimation Storyboard.TargetName="Hand"
>> Storyboard.TargetProperty="(RotateTransform.Angle)"
>> To="{Binding Path=Angle,
>> RelativeSource={RelativeSource TemplatedParent}}"
>> Duration="0:0:1" />
>> I get the following runtime error:
>>
>> "This Storyboard timeline tree could not be frozen. Please remove
>> thread-bound values such as bindings or dynamic resource references."
>>
>> Any ideas?
>> If I set the Angle rotation to an absolute value in the animation
>> (To="10") it works fine.
>> Thanks.
>>



My System SpecsSystem Spec
Old 05-04-2006   #4 (permalink)
Senkwe


 
 

Re: Databound animation

I had a similar problem and ended up resorting to using C# instead.

http://forums.microsoft.com/MSDN/Sho...50651&SiteID=1

I'll be following this thread with interest

My System SpecsSystem Spec
Old 04-13-2008   #5 (permalink)


Vista Ultimate 32bit
 
 

Re: Databound animation

I don't know if anyone is paying attention to this thread anymore, but I was doing something that similarly required TemplatedParent in the storyboard animation and I was able to find a solution.

The key was to bind the properties of the Content element of the ControlTemplate to the properties of the TemplatedParent, so..

So what you have to do is have some element in your control that binds to the Templated Parent property, and then the storyboard animation bound to that control, and it should work.

Last edited by brianshapiro; 04-13-2008 at 01:03 PM..
My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Untrapable exception when deleting last row in databound DataGridV .NET General


Vista Forums is an independent web site and has not been authorized,
sponsored, or otherwise approved by Microsoft Corporation.
"Windows Vista", the Start Orb, and related materials are trademarks of Microsoft Corp.
© Designer Media Ltd

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46