Use StringAnimationUsingKeyFrames to animate the text value of a TextBlock : Frame Animation « Windows Presentation Foundation « C# / CSharp Tutorial

Home
C# / CSharp Tutorial
1.Language Basics
2.Data Type
3.Operator
4.Statement
5.String
6.struct
7.Class
8.Operator Overload
9.delegate
10.Attribute
11.Data Structure
12.Assembly
13.Date Time
14.Development
15.File Directory Stream
16.Preprocessing Directives
17.Regular Expression
18.Generic
19.Reflection
20.Thread
21.I18N Internationalization
22.LINQ
23.GUI Windows Forms
24.Windows Presentation Foundation
25.Windows Communication Foundation
26.Workflow
27.2D
28.Design Patterns
29.Windows
30.XML
31.XML LINQ
32.ADO.Net
33.Network
34.Directory Services
35.Security
36.unsafe
C# / C Sharp
C# / C Sharp by API
C# / CSharp Open Source
C# / CSharp Tutorial » Windows Presentation Foundation » Frame Animation 
24.111.9.Use StringAnimationUsingKeyFrames to animate the text value of a TextBlock
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
    <Grid TextBlock.FontSize="192">
        <TextBlock Name="txtblk" Foreground="Black"
                   HorizontalAlignment="Center" VerticalAlignment="Center" />
    </Grid> 
    <Page.Triggers>
        <EventTrigger RoutedEvent="Canvas.Loaded">
            <BeginStoryboard>
                <Storyboard TargetName="txtblk" Duration="0:0:2" RepeatBehavior="Forever">
                    <StringAnimationUsingKeyFrames Storyboard.TargetProperty="Text">
                        <DiscreteStringKeyFrame KeyTime="0:0:0" Value="textBoxA" />
                        <DiscreteStringKeyFrame KeyTime="0:0:1" Value="B" />
                    </StringAnimationUsingKeyFrames>

                    <ColorAnimationUsingKeyFrames Storyboard.TargetProperty="Foreground.Color">
                        <DiscreteColorKeyFrame KeyTime="0:0:0" Value="Red" />
                        <DiscreteColorKeyFrame KeyTime="0:0:1" Value="Blue" />
                    </ColorAnimationUsingKeyFrames>
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Page.Triggers>
</Page>
WPF Use String Animation Using Key Frames To Animate The Text Value Of A Text Block
24.111.Frame Animation
24.111.1.Animation with Discrete Key FramesAnimation with Discrete Key Frames
24.111.2.Animation with Mixed Key Frames.xamlAnimation with Mixed Key Frames.xaml
24.111.3.Discrete Double Key FrameDiscrete Double Key Frame
24.111.4.Ball moves following spline key framesBall moves following spline key frames
24.111.5.Use ColorAnimationUsingKeyFrames to animate GradientStopUse ColorAnimationUsingKeyFrames to animate GradientStop
24.111.6.Use StringAnimationUsingKeyFrames to ColorUse StringAnimationUsingKeyFrames to Color
24.111.7.Using DiscreteStringKeyFrameUsing DiscreteStringKeyFrame
24.111.8.Use ColorAnimationUsingKeyFrames to animate the foreground color of a TextBlockUse ColorAnimationUsingKeyFrames to animate the foreground color of a TextBlock
24.111.9.Use StringAnimationUsingKeyFrames to animate the text value of a TextBlockUse StringAnimationUsingKeyFrames to animate the text value of a TextBlock
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.