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. php:Header

    转自鸟哥的博客: http://www.laruence.com/2007/12/16/308.html PHP header()the function declaration: void head ...

  2. NOIP2010 引水入城 题解

    http://www.rqnoj.cn/problem/601 今天发现最小区间覆盖竟然是贪心,不用DP!于是我又找到这题出来撸了一发. 要找到最上面每个城市分别能覆盖最下面哪些城市,如果最下面有城市 ...

  3. C/C++使用HTTP协议上传

    上传文件: http://zengrong.net/post/2088.htm #include <stdio.h> #include <string.h> #include ...

  4. java web

    1,当访问完一个网页的时候,浏览器会有缓存,当你再次输入原来的网站是会有从远端传来的网页缓存,所以在测试的时候要清除缓存才行

  5. Swift2.1 语法指南——嵌套类型

    原档:https://developer.apple.com/library/prerelease/ios/documentation/Swift/Conceptual/Swift_Programmi ...

  6. IDEA之maven(springmvc)项目

    1.在idea下创建maven项目(参考IDEA之web项目(maven项目)创建) 2.项目结构 3.web.xml <!DOCTYPE web-app PUBLIC "-//Sun ...

  7. java之String

    一.构造器 package com.string; import java.io.UnsupportedEncodingException; import java.nio.charset.Chars ...

  8. python 编码 UnicodeDecodeError

    将一个py脚本从Centos转到win运行,出错如下: UnicodeDecodeError: 'gbk' codec can't decode byte 0xff in position 0: il ...

  9. 关于百度地图api测距显示NaN的解决方案

    因为随着百度地图的api的升级,测距的函数以及语句都发生的一定变化. 在调用api测距的时候通常我们使用的是语句map.getDistance(marker1,marker2); 但为什么这么简单的测 ...

  10. Effective Java 读书笔记之二 对于所有对象都通用的方法

    尽管Object是一个具体的类,但设计它主要是为了扩展.它的所有非final方法都有明确的通用约定.任何一个类在override时,必须遵守这些通用约定. 一.覆盖equals时请遵守通用的约定 1. ...