WPF(1)Hello,WPF

以下是一段简单的say hello动画,说是简单,可自己也费了九牛之力啊
在Kaxaml中编辑, 用Xaml Hack 也可打开查看效果。由于对一些语法,属性还不熟悉,所以得借助Kaxaml所带的提示功能,比较郁闷的是这软件有时会因一些语法错误而导致直接退出

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

<Canvas>  
  
<Canvas.Triggers>
   
<EventTrigger RoutedEvent="Canvas.Loaded">
    
<EventTrigger.Actions>
        
<BeginStoryboard>
          
<Storyboard BeginTime="0" Duration="Forever">
              
<!-- "hello" Animation-->
              
<DoubleAnimation Storyboard.TargetName="hello" Storyboard.TargetProperty="(Canvas.Left)" From="0" To="500"  BeginTime="0:0:0" Duration="0:0:1.5" />
              
<DoubleAnimation Storyboard.TargetName="skew" Storyboard.TargetProperty="AngleX"  AutoReverse="True" DecelerationRatio="0.5" From="0" To="30"  BeginTime="0:0:1" Duration="0:0:0.8" />
              
<DoubleAnimation Storyboard.TargetName="hello" Storyboard.TargetProperty="(Canvas.Left)"  To="300"  BeginTime="0:0:3" Duration="0:0:0.5" />
               
<!-- "W" Animation-->
             
<DoubleAnimation Storyboard.TargetName="tbw" Storyboard.TargetProperty="(Canvas.Left)" From="350"  To="550"  BeginTime="0:0:3" Duration="0:0:0.35" />
             
<DoubleAnimation Storyboard.TargetName="tbw" Storyboard.TargetProperty="(Canvas.Top)" From="0"  To="180"  BeginTime="0:0:3" Duration="0:0:00.35" />
                
<!-- "P" Animation-->
               
<DoubleAnimation Storyboard.TargetName="tbp" Storyboard.TargetProperty="(Canvas.Left)" From="400"  To="700"  BeginTime="0:0:3.5" Duration="0:0:0.3" />
             
<DoubleAnimation Storyboard.TargetName="tbp" Storyboard.TargetProperty="(Canvas.Top)" From="0"  To="180"  BeginTime="0:0:3.5" Duration="0:0:0.3" />
               
<!-- "F" Animation-->
              
<DoubleAnimation Storyboard.TargetName="tbf" Storyboard.TargetProperty="(Canvas.Left)" From="450"  To="800"  BeginTime="0:0:4" Duration="0:0:0.3" />
             
<DoubleAnimation Storyboard.TargetName="tbf" Storyboard.TargetProperty="(Canvas.Top)" From="0"  To="180"  BeginTime="0:0:4" Duration="0:0:0.3" />
          
</Storyboard>
        
</BeginStoryboard>
    
</EventTrigger.Actions>
  
</EventTrigger>
</Canvas.Triggers><!-- Insert this sample as the child of a Page, Grid, Canvas, Button, or other container -->  

  
<TextBlock   x:Name="hello" Canvas.Top ="218" FontFamily="Segoe, Segoe UI, Arial" FontWeight="Bold" FontSize="80pt" Foreground="Chartreuse" Text ="Hello">
       
<TextBlock.RenderTransform > 
         
<SkewTransform x:Name="skew"  CenterX="50" CenterY="200" > </SkewTransform>
      
</TextBlock.RenderTransform>
  
</TextBlock>
   
<TextBlock x:Name ="tbw" Text ="W"  FontSize ="100pt" FontWeight ="Bold"  Canvas.Top="-1000"></TextBlock>
   
<TextBlock x:Name ="tbp" Text ="P"  FontSize ="100pt" FontWeight ="Bold" Canvas.Top="-1000" > </TextBlock>
   
<TextBlock x:Name ="tbf" Text ="F"  FontSize ="100pt" FontWeight ="Bold" Canvas.Top="-1000" > </TextBlock>
</Canvas>

</Page>
posted @ 2008-04-13 20:25  Anders06  阅读(397)  评论(0编辑  收藏  举报