Windows Vista Forums
Vista Forums Home Join Vista Forums Donate Vista Tutorials Tags

Welcome to Vista Forums we are your forum to discuss Windows Vista x64 and x86 systems. Whether you need help or just want to post an idea you have on Vista, this is the forum for you.
Register at Vista forums...the world biggest Windows Vista resource Join Vista Forums Now

Go Back   Vista Forums > Microsoft Technical Newsgroups > Avalon

Databound animation

Closed Thread
 
Thread Tools Display Modes
Old 05-03-2006   #1 (permalink)
Joao Paulo Duque Vieira
Guest


 

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.


Old 05-03-2006   #2 (permalink)
Pascal Bourque
Guest


 

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.
>

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


 

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.
>>



Old 05-04-2006   #4 (permalink)
Senkwe
Guest


 

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

Old 04-13-2008   #5 (permalink)
Newbie


  brianshapiro is offline

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 12:03 PM.
Closed Thread

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Databound treeview and selectedItem cast to Treeviewitem cheesetarmac Avalon 2 11-14-2006 03:43 AM
Textbox value to filter databound ListBox items? Olav Avalon 2 09-23-2006 12:55 PM
Select hidden treeviewitem in databound treeview RyanLeeSchneider Avalon 0 01-31-2006 06:59 AM
Update databound collection not in UI thread Daniel Danilin Avalon 1 01-10-2006 03:54 PM
Animation + Animation MueMeister Avalon 1 01-10-2006 03:53 PM








Vistax64.com 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 2005-2008

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 47 48 49 50