Animated transform : DoubleAnimation « 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 » DoubleAnimation 
24.115.2.Animated transform
<Window x:Class="Workspace.DockExample"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Workspace" Width="640" Height="480">
  <StackPanel>

    
    
    <Canvas Width="700" Height="400" HorizontalAlignment="Center">
      <TextBlock Canvas.Top="100" Canvas.Left="50"
        TextAlignment="Center" FontSize="16pt" Foreground="#CCCCFF"
        RenderTransformOrigin="0.5,0.5">
        <TextBlock.RenderTransform>
          <RotateTransform x:Name="MyAnimatedRotateTransform" Angle="0" />
        </TextBlock.RenderTransform>
        RotateTransform
      </TextBlock>
    
      <TextBlock Canvas.Top="100" Canvas.Left="300" Name="scaledText"
        TextAlignment="Center" FontSize="16pt" Foreground="Gray"
        RenderTransformOrigin="0.5,0.5">
        <TextBlock.RenderTransform>
          <ScaleTransform x:Name="MyAnimatedScaleTransform" ScaleX="1" ScaleY="1" />
        </TextBlock.RenderTransform>
        ScaleTransform
      </TextBlock>    
    
      <TextBlock Canvas.Top="250" Canvas.Left="150" 
        TextAlignment="Center" FontSize="16pt" Foreground="Orange"
        RenderTransformOrigin="0.5,0.5">
        <TextBlock.RenderTransform>
          <SkewTransform x:Name="MyAnimatedSkewTransform" AngleX="0" AngleY="0" />
        </TextBlock.RenderTransform>
        SkewTransform
      </TextBlock>      
    
      <TextBlock Canvas.Top="30" Canvas.Left="300" Name="translatedText"
        FontSize="16pt">
        <TextBlock.RenderTransform>
          <TranslateTransform x:Name="MyAnimatedTranslateTransform" X="0" Y="0" />
        </TextBlock.RenderTransform>
        TranslateTransform
      </TextBlock>      
    
    </Canvas>
  </StackPanel>
  

  <Window.Triggers>
    <EventTrigger RoutedEvent="Page.Loaded">
      <BeginStoryboard>
        <Storyboard>
          <DoubleAnimation 
            Storyboard.TargetName="MyAnimatedRotateTransform" 
            Storyboard.TargetProperty="Angle" 
            From="0" To="360" Duration="0:0:5" RepeatBehavior="Forever" />
          <ParallelTimeline RepeatBehavior="Forever" AutoReverse="True">
            <DoubleAnimation 
              Storyboard.TargetName="MyAnimatedScaleTransform" 
              Storyboard.TargetProperty="ScaleX"
              From="0" To="3" Duration="0:0:7" />
            <DoubleAnimation 
              Storyboard.TargetName="MyAnimatedScaleTransform" 
              Storyboard.TargetProperty="ScaleY"          
              From="0" To="3" Duration="0:0:7" />     
          </ParallelTimeline>
          <ParallelTimeline RepeatBehavior="Forever" AutoReverse="True">
            <DoubleAnimation 
              Storyboard.TargetName="MyAnimatedSkewTransform" 
              Storyboard.TargetProperty="AngleX"
              From="-45" To="70" Duration="0:0:10" />
            <DoubleAnimation 
              Storyboard.TargetName="MyAnimatedSkewTransform" 
              Storyboard.TargetProperty="AngleY"          
              From="-45" To="70" Duration="0:0:10" />       
          </ParallelTimeline>     
          <ParallelTimeline RepeatBehavior="Forever" AutoReverse="True">
            <DoubleAnimation 
              Storyboard.TargetName="MyAnimatedTranslateTransform" 
              Storyboard.TargetProperty="X"          
              From="0" To="100" Duration="0:0:5" />
            <DoubleAnimation 
              Storyboard.TargetName="MyAnimatedTranslateTransform" 
              Storyboard.TargetProperty="Y"          
              From="0" To="200" Duration="0:0:5" />   
          </ParallelTimeline>       
        </Storyboard>
      </BeginStoryboard>
    </EventTrigger>
  </Window.Triggers>

</Window>
WPF Animated Transform
24.115.DoubleAnimation
24.115.1.Remove aniamtion with RemoveStoryboardRemove aniamtion with RemoveStoryboard
24.115.2.Animated transformAnimated transform
24.115.3.Create DoubleAnimation and Animate a Button with Button.BeginAnimation and Button.WidthPropertyCreate DoubleAnimation and Animate a Button with Button.BeginAnimation and Button.WidthProperty
24.115.4.DoubleAnimation Loop foreverDoubleAnimation Loop forever
24.115.5.DoubleAnimation Loop three timesDoubleAnimation Loop three times
24.115.6.DoubleAnimation Loop for 30 secondsDoubleAnimation Loop for 30 seconds
24.115.7.TranslateTransform and DoubleAnimationTranslateTransform and DoubleAnimation
24.115.8.Path Animation with DoubleAnimationUsingPath, AutoReversePath Animation with DoubleAnimationUsingPath, AutoReverse
24.115.9.Animated Text TransformAnimated Text Transform
24.115.10.Markup for navigation transition animationsMarkup for navigation transition animations
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.