locked
TextBlock Foreground Color with Timeline RRS feed

  • Question

  • Hello

    There seems to be a bug when trying to change the Foreground Color of a textblock when using a timeline.  The animation appears correctly in Blend but when I try to execute the animation from managed code, the animation does not render.

     Managed Code:((Storyboard)this.FindName("Timeline1")).Begin();  //executes timeline when left mouse button is clicked

    Xaml (generated by Blend):

    <Canvas.Resources>    <Storyboard x:Name="Timeline1">        <ColorAnimationUsingKeyFrames BeginTime="00:00:00" Storyboard.TargetName="test" Storyboard.TargetProperty="(TextElement.Foreground).(SolidColorBrush.Color)">            <SplineColorKeyFrame KeyTime="00:00:02" Value="#FFFF0000"/>        </ColorAnimationUsingKeyFrames>    </Storyboard>

    </Canvas.Resources>

    Saturday, July 14, 2007 11:12 AM

All replies

  • To solve this, ensure that that the test TextBlock has its Foreground property set. I had the same problem.

     Regards,

    Daniel Vaughan

    Orpius.com
     

    Monday, November 5, 2007 12:51 AM