My Silverlight系列(6)—— c#版本的slilverlight.net官网导般栏
2009-04-25 12:04:45 来源:WEB开发网a.首先在名为move的Canvas内画上一条直线和一个三角形,用于指示当前选择的导航
b.创建一个动画,用以改变这个Canvas对于它的父容器(Canvas)的Canvas。Left属性,From和To两个属性将在代码中进行动态的设定
5)设计Description并为其应用动画
1 <StackPanel x:Name="descriptionPanel" Orientation="Horizontal" Grid.Row="2">
2 <StackPanel.Resources>
3 <Storyboard x:Name="description_appear">
4 <DoubleAnimation x:Name="description_appearAnimation" Storyboard.TargetName="descriptionPanel" Storyboard.TargetProperty="Opacity" From="0" To="1.0" Duration="0:0:0.2" AutoReverse="False" RepeatBehavior="1x"/>
5 </Storyboard>
6 <Storyboard x:Name="description_disappear" Completed="description_disappear_Completed">
7 <DoubleAnimation x:Name="description_disappearAnimation" Storyboard.TargetName="descriptionPanel" Storyboard.TargetProperty="Opacity" From="1.0" To="0" Duration="0:0:0.2" AutoReverse="False" RepeatBehavior="1x"/>
8 </Storyboard>
9 </StackPanel.Resources>
10 <Rectangle x:Name="imageContainer" Width="24" Height="24"/>
11 <TextBlock x:Name="descriptionTextBlock" Foreground="White" FontFamily="Verdana" FontSize="10" Margin="10 10 0 5"/>
12 </StackPanel>
Tags:My Silverlight 系列
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接