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 入门到精通 动画的更多相关文章

  1. wp8 入门到精通 虚拟标示符 设备ID

    //获得设备虚拟标示符 wp8 public string GetWindowsLiveAnonymousID() { object anid = new object(); string anony ...

  2. wp8 入门到精通 仿美拍评论黑白列表思路

    static bool isbool = false; private void BindGameDelete() { Tile tile = new Tile(); List<Color> ...

  3. wp8 入门到精通 生命周期

  4. wp8 入门到精通 定时更新瓷贴

    public class ScheduledAgent : ScheduledTaskAgent { static ScheduledAgent() { Deployment.Current.Disp ...

  5. wp8 入门到精通 ImageCompress 图片压缩

    //实例化选择器 PhotoChooserTask photoChooserTask = new PhotoChooserTask(); BitmapImage bimg; int newPixelW ...

  6. wp8 入门到精通 Gallery

    <Grid x:Name="LayoutRoot" Background="Transparent"> <Grid.Resources> ...

  7. wp8 入门到精通 MultiMsgPrompt

    List<NotifyMsg> arraymsg = new List<NotifyMsg>(); List<NotifyInfo> ArrayNotifyInfo ...

  8. wp8 入门到精通 数据库更新字段(一)

    public class UserInfoDB : BaseDB { public UserInfoDB() : base(@"Data Source=isostore:\MakeLove\ ...

  9. wp8 入门到精通 启动系统分享照片任务

    PhotoChooserTask photoChooserTask = new PhotoChooserTask(); photoChooserTask.Completed += photoChoos ...

随机推荐

  1. emmet使用 及 notepadd++ emmet的安装

    emmet的使用的参考文章:http://www.cnblogs.com/sussski/p/3544744.html html:4s.html:4t.html:5或! +.>.^:层次 *.@ ...

  2. zabbix 邮件报错 Support for SMTP authentication was not compiled in

    服务器系统是centos6.5 zabbix版本是3.0.4 根据 网上教程配置好邮件脚本后,触发发送邮件的时候报错: Support for SMTP authentication was not ...

  3. Dynamic Virtual Channels

    refer http://blogs.msdn.com/b/rds/archive/2007/09/20/dynamic-virtual-channels.aspx An important goal ...

  4. Memcache的部署和使用(转)

    一.memcache简介 Memcache是danga.com的一个项目,最早是为 LiveJournal 服务的,目前全世界不少人使用这个缓存项目来构建自己大负载的网站,来分担数据库的压力. Mem ...

  5. WPF 窗口在右下角出现,识别分辨率

    直接上代码. Point brp = SystemParameters.WorkArea.BottomRight;//当前桌面右下角的位置

  6. centos6.4.yum-lamp环境设置

    首先防火墙开启mysql:3306 apache 80 and 81端口: vi /etc/sysconfig/iptables -A INPUT -m state --state NEW -m tc ...

  7. ASP.NET MVC学习笔记-----Bundles

    在网页中,我们经常需要引用大量的javascript和css文件,在加上许多javascript库都包含debug版和经过压缩的release版(比如jquery),不仅麻烦还很容易引起混乱,所以AS ...

  8. 《深入PHP与jQuery开发》读书笔记——Chapter2

    Pro PHP and jQuery Chapter2 总结 1.理解jQuery脚本的基本行为 jQuery事实上沿用了JavaScript的那一套东西,几乎所有方法都支持链式调用,也就是说方法可以 ...

  9. xpath基础知识

    相关链接: http://www.ruanyifeng.com/blog/2009/07/xpath_path_expressions.html 自动生成xpath的工具: http://blog.s ...

  10. More is better(MST)(求无向图中最大集合元素个数)

    More is better Time Limit:1000MS     Memory Limit:102400KB     64bit IO Format:%I64d & %I64u Sub ...