private async void DoAnimistion()
{
Storyboard storyboard = new Storyboard();
using (IEnumerator<DependencyObject> enumerator = stack.Children.ToList().GetEnumerator())
      //此处的stack是一个StackPanel,我要对它的子元素做动画
{
Random random = new Random();
TimeSpan time = TimeSpan.FromSeconds(0.0);
var ts = TimeSpan.FromMilliseconds(80.0);
double angle = -120.0;
while (enumerator.MoveNext())
{ //double num = random.Next(200, 500); FrameworkElement frameworkElement = (FrameworkElement)enumerator.Current; DoubleAnimationUsingKeyFrames xdoubleAnimationUsingKeyFrames = new DoubleAnimationUsingKeyFrames();
xdoubleAnimationUsingKeyFrames.KeyFrames.Add(CreateKeyFrame(KeyTime.FromTimeSpan(time), ));
xdoubleAnimationUsingKeyFrames.KeyFrames.Add(CreateKeyFrame(KeyTime.FromTimeSpan(time.Add(TimeSpan.FromSeconds(0.3))), ));
Storyboard.SetTarget(xdoubleAnimationUsingKeyFrames, frameworkElement);
Storyboard.SetTargetName(xdoubleAnimationUsingKeyFrames, frameworkElement.Name);
Storyboard.SetTargetProperty(xdoubleAnimationUsingKeyFrames, TargetProperty.RenderTransformTranslateX);
storyboard.Children.Add(xdoubleAnimationUsingKeyFrames); DoubleAnimationUsingKeyFrames ydoubleAnimationUsingKeyFrames = new DoubleAnimationUsingKeyFrames();
ydoubleAnimationUsingKeyFrames.KeyFrames.Add(CreateKeyFrame(KeyTime.FromTimeSpan(time), angle));
ydoubleAnimationUsingKeyFrames.KeyFrames.Add(CreateKeyFrame(KeyTime.FromTimeSpan(time.Add(TimeSpan.FromSeconds(0.3))), ));
Storyboard.SetTarget(ydoubleAnimationUsingKeyFrames, frameworkElement);
Storyboard.SetTargetName(ydoubleAnimationUsingKeyFrames, frameworkElement.Name);
Storyboard.SetTargetProperty(ydoubleAnimationUsingKeyFrames, TargetProperty.ProjectionRotationY);
storyboard.Children.Add(ydoubleAnimationUsingKeyFrames); var num3 = -1.0 * (Math.Tan(DegreesToRadians(angle)) * frameworkElement.ActualWidth);
num3 += frameworkElement.ActualWidth;
DoubleAnimationUsingKeyFrames zdoubleAnimationUsingKeyFrames = new DoubleAnimationUsingKeyFrames();
zdoubleAnimationUsingKeyFrames.KeyFrames.Add(CreateKeyFrame(KeyTime.FromTimeSpan(time), num3));
zdoubleAnimationUsingKeyFrames.KeyFrames.Add(CreateKeyFrame(KeyTime.FromTimeSpan(time.Add(TimeSpan.FromSeconds(0.3))), ));
Storyboard.SetTarget(zdoubleAnimationUsingKeyFrames, frameworkElement);
Storyboard.SetTargetName(zdoubleAnimationUsingKeyFrames, frameworkElement.Name);
Storyboard.SetTargetProperty(zdoubleAnimationUsingKeyFrames, TargetProperty.ProjectionGlobalOffsetZ);
storyboard.Children.Add(zdoubleAnimationUsingKeyFrames); time = time.Add(ts);
}
}
storyboard.Begin();
}
public static double DegreesToRadians(double degrees)
        {
            return degrees * 2.0 * 3.1415926535897931 / 360.0;
        }

winrt 页面进入动画的更多相关文章

  1. (原)android中的动画(三)之动画监听&页面切换动画

    1.动画也可以设置监听事件,例如在动画结束时需要执行某操作 把要执行的代码写在onAnimationEnd()回调方法中即可: anim.setAnimationListener(new Animat ...

  2. HTML页面的动画的制作及性能

    原文:HTML页面的动画的制作及性能 WEB页面的动画的制作及性能 简介 目前WEB页面做动画的方式大的分两种1.JS间隔时间不断修改元素属性值,这也是CSS3出来前常用的做法,貌似也是唯一的做法.2 ...

  3. iOS页面切换动画实现方式。

    iOS页面切换动画实现方式. 1.使用UIView animateWithDuration:animations:completion方法 Java代码 [UIView animateWithDura ...

  4. QtQuick多页面切换、多页面切换动画、多个qml文件数据交互

    一.QtQuick多页面切换方法 (1)“隐藏法” 前一个视图visible设为false或者透明度opacity设为0,相当于“隐藏”了,实际还存在: 要显示的视图visible设为true或者透明 ...

  5. demo: 全页面CSS3动画的一个参考例子

    全页面CSS3动画的一个参考例子: http://wow.blizzard.cn/wow/wod-achievement/ 魔兽的一个活动页 第二页.第三页,文字进入页面 <script src ...

  6. (私人收藏)64个精致的页面loadinggif动画

    64个精致的页面loadinggif动画 https://pan.baidu.com/s/18bfktLZ90jQ7l2kSmMv-dgnmm5

  7. 利用CSS3实现div页面淡入动画特效

    利用CSS3实现页面淡入动画特效   摘要 利用CSS3动画属性"@keyframes "可实现一些动态特效,具体语法和参数可以网上自行学习.这篇文章主要是实践应用一下这个动画属性 ...

  8. 利用CSS3实现页面淡入动画特效

    利用CSS3动画属性"@keyframes "可实现一些动态特效,具体语法和参数可以网上自行学习.这篇文章主要是实践应用一下这个动画属性,实现页面淡入特效,在火狐24版.chrom ...

  9. Windows Phone使用sliverlight toolkit实现页面切换动画效果

    使用应用时,好多app在页面切换的时候都有一个动画效果,感觉很炫,也大大增加了用户体验,怎么实现呢? 界面的切换,可以用Windows Phone Toolkit中的TransitionService ...

随机推荐

  1. 黄永成-thinkphp讲解-个人博客讲解25集

    整个网站的根目录用blog你要跟别人说起,自己好识别的文件夹名字. 下面的项目名称 就不再重复的写了, 直接用App就好了. 网站访问: ...../index.php(入口文件)/Admin(模块名 ...

  2. CF451B Sort the Array 水题

    Codeforces Round #258 (Div. 2) Sort the Array B. Sort the Array time limit per test 1 second memory ...

  3. 2013成都Regional:一块木板,几个气球

    先来看木板: 再来看气球: 最后看木板+气球: google送的纪念品....  到现在还没敢打乱: 赛场外面.... 赛场里面: 和比赛时出了问题,并现场换了一台的电脑(对面长安大学1队)... 最 ...

  4. Bus Hound 的使用方法

    背景: 最近在研究USB相关协议,需要对USB数据进行抓取分析,Bus Hound是个非常赞的工具,在此将其使用方法记录下来,以备下次快速上手使用. 正文: 主界面如下: 首先关注菜单栏三个选项: C ...

  5. 2015Summer Training #2

    暑假集训昨天刚开始,14级的小伙伴快到齐了,hhhhh ,毕竟下学期区域赛,对我们来说还是很困难的. 打算每天写份总结. UVA 11300 C.Spreading the Wealth 题目大意:n ...

  6. Mac 下用IDEA时maven,ant打包 (mr 入库hbase)

    现在非常喜欢IDEA,之前在mac 上用的eclipse 经常出现无缘无故的错误.所以转为IDEA.  不过新工具需要学习成本,手头上的项目就遇到了很多问题,现列举如下: 背景描述 在hadoop 开 ...

  7. java依赖注入

    接口的作用 1.在spide中创建一个私有接口 private Downloadable downlaodable 覆盖set get 方法 创建一个方法  Public Page down load ...

  8. Linux之服务器时间同步

    Linux时间同步(把nameNode1作为时间同步服务器) 设置时区 cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 联网情况:ntpdate ...

  9. 支付安全基础 —— HTTPS的故事

     本文主要讲述了HTTPS的基本原理,通过HTTPS握手过程.证书链.中间人攻击.CA机构等问题,详细解释了百付宝系统中用到的HTTPS安全知识,同时,介绍了如何查看www.baifubao.com的 ...

  10. jQuery Validate 表单验证

    在做网页表单时时常需要在客户端对表单填写的数据进行验证一番才能提交,我们可以通过自己编写JavasScript代码来验证,但是有时数据量过多时就会有些难度了.基于jQuery的jquery.valid ...