TextBlock Opacity Animation : TextBlock « Windows Presentation Foundation « C# / C Sharp






TextBlock Opacity Animation

TextBlock Opacity Animation
     

<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <TextBlock x:Name="txtblk" Text="XAML" 
               FontSize="144pt" FontFamily="Arial Black"
               HorizontalAlignment="Center" VerticalAlignment="Center">

        <TextBlock.Triggers>
            <EventTrigger RoutedEvent="TextBlock.Loaded">
                <BeginStoryboard>
                    <Storyboard TargetName="txtblk" 
                                TargetProperty="Opacity"
                                RepeatBehavior="Forever">
                        <DoubleAnimationUsingPath Duration="0:0:4" 
                                                  Source="Y">
                            <DoubleAnimationUsingPath.PathGeometry>
                                <PathGeometry>
                                    <PathGeometry.Figures>
                                        <PathFigure StartPoint="0 0">
                                            <LineSegment Point="0 1" />
                                            <LineSegment Point="2 1" />
                                            <LineSegment Point="2 0" />
                                        </PathFigure>
                                    </PathGeometry.Figures>
                                </PathGeometry>
                            </DoubleAnimationUsingPath.PathGeometry>
                        </DoubleAnimationUsingPath>
                    </Storyboard>
                </BeginStoryboard>
            </EventTrigger>
        </TextBlock.Triggers>
    </TextBlock>
</Page>

   
    
    
    
    
  








Related examples in the same category

1.TextBlock VerticalAlignmentTextBlock VerticalAlignment
2.Emboss TextEmboss Text
3.Engrave TextEngrave Text
4.TextBlock ScaleTransform ScaleXTextBlock ScaleTransform ScaleX
5.TextBlock ScaleTransform ScaleY and TransformGroupTextBlock ScaleTransform ScaleY and TransformGroup
6.Text Drop ShadowText Drop Shadow
7.Adding Hyperlink to TextBlockAdding Hyperlink to TextBlock
8.Spell Check a TextBox or RichTextBox Control in Real TimeSpell Check a TextBox or RichTextBox Control in Real Time
9.Animates the text block's colorAnimates the text block's color
10.Animates the text block's opacity(fading text)Animates the text block's opacity(fading text)
11.Animates the text block's widthAnimates the text block's width
12.TextEffect to animateTextEffect to animate
13.Animates the horizontal center of the RotateTransform applied to the TextEffect
14.Animates the position of the TextEffect
15.Set TextBlock.FontSize for Grid
16.Add TextBlock into a GridAdd TextBlock into a Grid
17.Intrinsic character direction in TextBlockIntrinsic character direction in TextBlock
18.Mixed character directions and TextBlockMixed character directions and TextBlock
19.FlowDirection of TextBlockFlowDirection of TextBlock
20.Use RenderTransform to transform a TextBlockUse RenderTransform to transform a TextBlock
21.Use LayoutTransform to transform a TextBlockUse LayoutTransform to transform a TextBlock
22.Set Margins for TextBlock in Grid ResourceSet Margins for TextBlock in Grid Resource
23.Set TextWrapping to True for TextBlockSet TextWrapping to True for TextBlock
24.Set ToolTip text for TextBlockSet ToolTip text for TextBlock
25.Set Text value for TextBlockSet Text value for TextBlock
26.Set Foreground color for TextBlockSet Foreground color for TextBlock
27.Add Border to TextBlockAdd Border to TextBlock
28.Empirical Tilted Text ShadowEmpirical Tilted Text Shadow
29.Fill the overline decoration with a linear gradient brush in C#Fill the overline decoration with a linear gradient brush in C#
30.Fill the baseline decoration with a linear gradient brush in C#Fill the baseline decoration with a linear gradient brush in C#
31.Fill the underline decoration with a solid color brush in C#Fill the underline decoration with a solid color brush in C#
32.Fill the strikethrough decoration with a solid color brush in C#Fill the strikethrough decoration with a solid color brush in C#
33.Put Rectangle into TextBlockPut Rectangle into TextBlock
34.Programmatically change the way in which TextBlock is trimmed when it exceeds the outer boundaries of its containing box.Programmatically change the way in which TextBlock is trimmed when it exceeds the outer boundaries of its containing box.
35.Effects of the enumerated values of TextWrapping.Effects of the enumerated values of TextWrapping.
36.Simple underline decorationSimple underline decoration
37.Use Run the mark underlink TextDecorationsUse Run the mark underlink TextDecorations
38.VerticalAlignment=Top HorizontalAlignment=LeftVerticalAlignment=Top  HorizontalAlignment=Left