![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| 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. |
| |||||||
| |
| | #1 (permalink) |
| | 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 Specs![]() |
| 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 | |||