wp8 入门到精通 动画
http://samples.msdn.microsoft.com/Silverlight/SampleBrowser/index.htm#/?sref=transforms_ovw_animating_transforms
public Storyboard HideStoryBoard()
{
Storyboard storyboard = new Storyboard();
double num = 0.2;
DoubleAnimation animation = new DoubleAnimation();
Storyboard.SetTarget(animation, sp);
animation.SetValue(Storyboard.TargetPropertyProperty, new PropertyPath("(UIElement.RenderTransform).(CompositeTransform.TranslateX)"));
animation.To = ;
animation.From = ((CompositeTransform)sp.RenderTransform).TranslateX;
animation.Duration = new Duration(TimeSpan.FromSeconds(num)); PowerEase ease = new PowerEase();
ease.EasingMode = EasingMode.EaseInOut;
ease.Power = 2.0;
animation.EasingFunction = ease; DoubleAnimation animationOpacity = new DoubleAnimation();
Storyboard.SetTarget(animationOpacity, sp);
animationOpacity.SetValue(Storyboard.TargetPropertyProperty, new PropertyPath("UIElement.Opacity"));
animationOpacity.To = ;
animationOpacity.From = ;
animationOpacity.Duration = new Duration(TimeSpan.FromSeconds(num)); animationOpacity.SetValue(Storyboard.TargetNameProperty, "sp");
animationOpacity.SetValue(Storyboard.TargetPropertyProperty, new PropertyPath("UIElement.Opacity")); Storyboard.SetTargetName(animationOpacity, sp.Name);
Storyboard.SetTargetProperty(animationOpacity, new PropertyPath(StackPanel.OpacityProperty)); storyboard.Children.Add(animation);
storyboard.Children.Add(animationOpacity);
return storyboard;
}
<Button x:Name="myStackPanel">
<Button.Triggers>
<EventTrigger>
<BeginStoryboard>
<Storyboard>
<ColorAnimation BeginTime="00:00:00" From="Red" To="Transparent" Duration="0:0:3"
Storyboard.TargetName="mySolidColorBrush"
Storyboard.TargetProperty="Color">
</ColorAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Button.Triggers>
<Button.Background>
<SolidColorBrush x:Name="mySolidColorBrush" Color="Red" />
</Button.Background>
</Button>
wp8 入门到精通 动画的更多相关文章
- wp8 入门到精通 虚拟标示符 设备ID
//获得设备虚拟标示符 wp8 public string GetWindowsLiveAnonymousID() { object anid = new object(); string anony ...
- wp8 入门到精通 仿美拍评论黑白列表思路
static bool isbool = false; private void BindGameDelete() { Tile tile = new Tile(); List<Color> ...
- wp8 入门到精通 生命周期
- wp8 入门到精通 定时更新瓷贴
public class ScheduledAgent : ScheduledTaskAgent { static ScheduledAgent() { Deployment.Current.Disp ...
- wp8 入门到精通 ImageCompress 图片压缩
//实例化选择器 PhotoChooserTask photoChooserTask = new PhotoChooserTask(); BitmapImage bimg; int newPixelW ...
- wp8 入门到精通 Gallery
<Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.Resources> ...
- wp8 入门到精通 MultiMsgPrompt
List<NotifyMsg> arraymsg = new List<NotifyMsg>(); List<NotifyInfo> ArrayNotifyInfo ...
- wp8 入门到精通 数据库更新字段(一)
public class UserInfoDB : BaseDB { public UserInfoDB() : base(@"Data Source=isostore:\MakeLove\ ...
- wp8 入门到精通 启动系统分享照片任务
PhotoChooserTask photoChooserTask = new PhotoChooserTask(); photoChooserTask.Completed += photoChoos ...
随机推荐
- fork Bomb
类Unix ;(){:|:&};: windows %0|%0
- Jenkins 搭建U3D自动发布 IOS
http://www.cnblogs.com/yinghuochong/archive/2013/09/01/3294940.html 1.安装包,工具略过. 2.插件管理 Subversion Pl ...
- ASP.NET版Memcached监控工具(转载)
在上一篇文章<使用Memcached提高.NET应用程序的性能>中周公讲述如何在.NET中使用Memcached来提高.NET应用程序的性 能.在实际的使用中有可能出现Memcached因 ...
- 一步一步教你如何在linux下配置apache+tomcat(转)
一步一步教你如何在linux下配置apache+tomcat 一.安装前准备. 1. 所有组件都安装到/usr/local/e789目录下 2. 解压缩命令:tar —vxzf 文件名(. ...
- virtualbox 不能为虚拟电脑打开一个新任务/VT-x features locked or unavailable in MSR.
确保了主机的BIOS中开启了Intel Virtual Technology,虚拟机配置中勾选了“启用VT-x/AMD-V”. 这是因为CPU不支持VT-X技术或者VT-X技术被锁定. 如果不打开虚拟 ...
- Android-调用优酷SDK上传视频
最近在研究用优酷的SDK来进行视频上传的功能,由于优酷的SDK只是提供了一个上传的sample code,没有涉及到授权的过程,对于新手来说,可能非常棘手,现在分享一下我的思路: 程序实现前我们先 ...
- css 伪类::after ::beftor 的使用方式
注释:对于 IE8 及更早版本中的 :before,必须声明 . ::before和::after这两个主要用来给元素的前面或后面插入内容,这两个常用"content"配合使用,见 ...
- cocos2d-x创建精灵动画方式汇总
1.创建精灵框架缓存,并向其中添加相应的动画文件(plist),最后,通过动画集缓存生产动画 CCSpriteFrameCache *cache = CCSpriteFrameCache::share ...
- Java中的构造函数和重载
一.Java中的构造函数 构造函数是对象被创建时初始化对象的成员方法,它具有和它所在的类完全一样的名字.构造函数只能有入口参数,没有返回类型,因为一个类的构造方法的返回类就是类本身.构造函数定义后,创 ...
- Linux下的网络管理工具—OpenNMS
导读 OpenNMS的是一个运营商级别的,高度集成的,开放源码的平台,用于构建网络监控解决方案.OpenNMS有两个发行版:Meridian and Horizon.使用Meridian是可取的,对企 ...