![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
|
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.
br> br> |
| |||||||
![]() |
| | Thread Tools | Display Modes |
| | #1 (permalink) |
| 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. |
| | #2 (permalink) |
| 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. > |
| | #3 (permalink) |
| 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. >> |
| | #4 (permalink) |
| 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 |
| | #5 (permalink) |
| Newbie | 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. |
| |
| |
![]() |
| 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 |