silverlight:稳扎稳打Silverlight(37) - 3.0动画的Easing(缓动效果)

稳扎稳打Silverlight(37) - 3.0动画的Easing(缓动效果)(1) - 收藏本文



  CustomEasing.xaml

<navigation:Page x:Class="Silverlight30.Animation.CustomEasing"
           xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
           xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
           xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
           xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
           mc:Ignorable="d"
           xmlns:custom="clr-:Silverlight30.Animation"
           xmlns:navigation="clr-:.Windows.Controls;assembly=.Windows.Controls.Navigation"
           d:DesignWidth="640" d:DesignHeight="480"
           Title="CustomEasing Page">
    <Grid x:Name="LayoutRoot">
        <StackPanel>
       
            <StackPanel.Resources>
                <Storyboard x:Name="ani">
                    <DoubleAnimation
                        Storyboard.TargetName="tt"
                        Storyboard.TargetProperty="Y"
                        From="0"
                        To="200"
                        Duration="00:00:03"
                    >
                        <DoubleAnimation.EasingFunction>
                            <!--使用自定义缓动效果-->
                            <custom:MyCustomEasing EasingMode="EaseOut" />
                        </DoubleAnimation.EasingFunction>
                    </DoubleAnimation>
                </Storyboard>
            </StackPanel.Resources>

            <Button x:Name="btnShow" Content="演示" Margin="5" Click="btnShow_Click" />

            <Rectangle x:Name="rect" Fill="Blue" Width="200" Height="40" Margin="5" RenderTransformOrigin="0.5,0.5">
                <Rectangle.RenderTransform>
                    <TransformGroup>
                        <TranslateTransform x:Name="tt" X="0" Y="0" />
                    </TransformGroup>
                </Rectangle.RenderTransform>
            </Rectangle>
           
        </StackPanel>
    </Grid>
</navigation:Page>




  CustomEasing.xaml.cs

using ;
using .Collections.Generic;
using .Linq;
using .Net;
using .Windows;
using .Windows.Controls;
using .Windows.Documents;
using .Windows.Input;
using .Windows.Media;
using .Windows.Media.Animation;
using .Windows.Shapes;
using .Windows.Navigation;

Silverlight30.Animation
{
    public partial CustomEasing : Page
    {
        public CustomEasing
        {
            InitializeComponent;
        }

        private void btnShow_Click(object sender, RoutedEventArgs e)
        {
            ani.Begin;
        }
    }
}


  OK



编缉推荐阅读以下文章

  • 稳扎稳打Silverlight(36) - 3.0Control控件的TreeView, ListBox增强, DataGrid增强, MediaElement增强
  • 稳扎稳打Silverlight(35) - 3.0Control控件的ChildWindow, SaveFileDialog, HeaderedItemsControl, VirtualizingStackPanel
  • 稳扎稳打Silverlight(34) - 3.0Control控件的Frame, Page, Label, DescriptionViewer, ValidationSummary
  • 稳扎稳打Silverlight(33) - 3.0Control控件的AutoCompleteBox, DataPager
  • 稳扎稳打Silverlight(32) - 2.0Tip/Trick的MessageBox, Popup……
  • 稳扎稳打Silverlight(31) - 2.0Tip/Trick的加载XAP, 加载XAML, 加载DLL, AppManest.xaml文件介绍说明, 自定义鼠标指针
  • 稳扎稳打Silverlight(30) - 2.0Tip/Trick的Silverlight.js…
  • 稳扎稳打Silverlight(29) - 2.0Tip/Trick的Cookie, 自定义字体, 为传递参数, 自定义鼠标右键, 常用配置参数
  • 稳扎稳打Silverlight 2.0 系列文章索引

页123="current">4


最近更新最后刷新时间:2009-08-25 00:44:29

  • 稳扎稳打Silverlight(37) - 3.0动画的Easing(缓动效果)
  • 稳扎稳打Silverlight(36) - 3.0Control控件的TreeView, ListBox增强, DataGrid增强, MediaElement增强
  • 稳扎稳打Silverlight(35) - 3.0Control控件的ChildWindow, SaveFileDialog, HeaderedItemsControl, VirtualizingStackPanel
  • 稳扎稳打Silverlight(34) - 3.0Control控件的Frame, Page, Label, DescriptionViewer, ValidationSummary
  • 稳扎稳打Silverlight(33) - 3.0Control控件的AutoCompleteBox, DataPager
  • 使用Flash Builder 4 beta进行以数据为中心开发
  • 基于Facebook和Flash平台应用架构解析()
  • Flash cs3仿真艺术设计:模糊滤镜应用
  • 基于SoPC目标板Flash编程设计创建及应用
  • Flash AS教程:propertydata问题解决


设计资讯

  • ·如何抓住明天中国消费者?
  • ·揭秘动画大片功夫熊猫是如何炼成
  • ·我国动漫产业发展 4大难题亟待破解
  • ·曹鹏:痛批伪成功学
  • ·曹鹏:新概念成就英语
  • ·曹鹏:英语+编程威力
  • ·遇见曹鹏是学习者幸运
  • ·曹鹏:谈设计和开发
  • ·火星时代原创动画梦想来了
  • ·数字水墙 08年世博会亮相

专题推荐

  • ·Flash 8 入门经典教程
  • ·Flash 8.0 动画编程视频教程
  • ·Flash 8 例子视频教程
  • ·Flash AS 入门到精通教程
  • ·Flash Action Script 3
  • ·Flash 遮罩入门
  • ·Flash 补间动画
  • ·Flash 绘画教程
  • ·Flash 游戏开发例子
  • ·Flash 动画例子教程
  • ·SilverLight 专题
  • ·更多Flash专题>>>



有关我们 | 联系我们 | 版权申明 | 广告服务 | 网站WebSite律师 | 报告 | 免责条款

Copyright © 2002 - 2009 ddvip All Rights Reserved

版权所有



Tags:  silverlight.exe silverlight3 silverlight是什么 silverlight

延伸阅读

最新评论

发表评论