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 - Style binding

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


 
 

Style binding

Hello.

I’ve built a custom control based on the Control type.
It’s an analog clock with a hand for the seconds.

I wanted to set an animation for each elapsed second.
The animation would simply take the seconds hand from wherever it is to the
next second position (angle).



When I try to set the animation, I get the following error:

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



If I change the “To” property value from a binding to a discrete value, it
works fine.
Do you have any ideas? Thanks a lot.

The style definition in generic.xaml is:

<Style TargetType="{x:Type local:Clock}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type local:Clock}">
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="local:Clock.SecondsChanged">
<EventTrigger.Actions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation To="{Binding Path=SecondsAngle, RelativeSource={RelativeSource
TemplatedParent}}"
Duration="0:0:1" Storyboard.TargetName="SecondsHand"

Storyboard.TargetProperty="(Path.RenderTransform).(RotateTransform.Angle)"
/>
</Storyboard>
</BeginStoryboard>
</EventTrigger.Actions>
</EventTrigger>
</ControlTemplate.Triggers>
<Path x:Name="SecondsHand" Data="M 50 50 L 50 15 M 50 50 L 50 55"
Stroke="Black">
<Path.RenderTransform>
<RotateTransform x:Name="AngleTransform" CenterX="50" CenterY="50"

Angle="{Binding Path=SecondsAngle, RelativeSource={RelativeSource
TemplatedParent}}" />
</Path.RenderTransform>
</Path>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>



My System SpecsSystem Spec
 

Thread Tools


Similar Threads
Thread Forum
Font Size - XP style vs Vista style Vista General
Font Size - XP style vs Vista style Vista General
Font Size - XP style vs Vista style Vista 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