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 ...
随机推荐
- ASP.NET MVC学习笔记-----ActionInvoker
还是这张图: 当ControllerFactory生成Controller实例后,这时就需要使用ActionInvoker来选择调用一个合适的Action执行.ASP.NET MVC提供的基类Cont ...
- this prototype 闭包 总结
this对象 整理下思路: 一般用到this中的情景: 1.构造方法中 function A(){ this.name="yinshen"; } var a=new A(); co ...
- Hibernate4 执行存储过程
Hibernate3.3.2版本中getSession().connection()已被弃用,hibernate4中官方推荐使用Session doWork()方法进行jdbc操作 当Hibernat ...
- 用firebug给firefox添加信任链接
在前文“firefox查看微信公众平台的数据分析时就出现不信任链接怎么办?”我们使用了导入证书的方法添加信任链接,有网友反映说证书导入不成功,这里用另外一种方法来实现:用firebug给firefox ...
- acdream.LCM Challenge(数学推导)
LCM Challenge Time Limit:1000MS Memory Limit:64000KB 64bit IO Format:%lld & %llu Submit ...
- C#父类子类对象关系
案例: 主要有Vehicle.cs Airplane.cs Car.cs 3个类. Car和Airplane都继承与Vehicle类.Vehicle中Drive为虚方法,可在子类中重写,父类引 ...
- MySQL之扩展(触发器,存储过程等)
视图 视图是一个虚拟表(非真实存在),其本质是[根据SQL语句获取动态的数据集,并为其命名],用户使用时只需使用[名称]即可获取结果集,并可以将其当作表来使用. SELECT * FROM ( SEL ...
- [ruby on rails] 跟我学之(8)修改数据
修改views 修改index视图(app/views/posts/index.html.erb),添加编辑链接,如下: <h1>Our blogs</h1> <% @p ...
- 查看Eclipse中的jar包的源代码:jd-gui.exe
前面搞了很久的使用JAD,各种下载插件,最后配置好了,还是不能用,不知道怎么回事, 想起一起用过的jd-gui.exe这个工具,是各种强大啊!!! 只需要把jar包直接扔进去就可以了,非常清晰,全部解 ...
- 22.整数二进制表示中1的个数[Get1BitCount]
[题目] 输入一个整数,求该整数的二进制表达中有多少个1.例如输入10,由于其二进制表示为1010,有两个1,因此输出2. [分析] 如果一个整数不为0,那么这个整数至少有一位是1.如果我们把这个整数 ...