博客园 首页 私信博主 显示目录 隐藏目录 管理 动画

简单的动画

 1  <TextBlock Name="lblStyled" Text="Hello, styled world!" FontSize="18" HorizontalAlignment="Center" VerticalAlignment="Center">
 2             <TextBlock.Style>
 3                 <Style TargetType="TextBlock">
 4                     <Style.Triggers>
 5                         <EventTrigger RoutedEvent="MouseEnter">
 6                             <EventTrigger.Actions>
 7                                 <BeginStoryboard>
 8                                     <Storyboard>
 9                                         <DoubleAnimation Duration="0:0:0.300" Storyboard.TargetProperty="FontSize" To="28" />
10                                     </Storyboard>
11                                 </BeginStoryboard>
12                             </EventTrigger.Actions>
13                         </EventTrigger>
14                         <EventTrigger RoutedEvent="MouseLeave">
15                             <EventTrigger.Actions>
16                                 <BeginStoryboard>
17                                     <Storyboard>
18                                         <DoubleAnimation Duration="0:0:0.800" Storyboard.TargetProperty="FontSize" To="18" />
19                                     </Storyboard>
20                                 </BeginStoryboard>
21                             </EventTrigger.Actions>
22                         </EventTrigger>
23                     </Style.Triggers>
24                 </Style>
25             </TextBlock.Style>
26         </TextBlock>

 

posted @ 2016-04-08 07:53  ants_double  阅读(124)  评论(0编辑  收藏  举报