Silverlight滑动动画
来源:互联网 发布:opencv算法精解 编辑:程序博客网 时间:2024/05/02 08:21
话说对于刚刚学习SL的人来说,特别是从HTML跳过来 玩动画的时候 那边的思路很多不通的,在SL里面的滑动直接更换Margin不行,后面慢慢摸索才弄出来 的 希望对大家有帮助
目前只是写了一步,以后可以根据自己扩展
Dome
http://download.csdn.net/detail/qq873113580/5993237
前台
<Grid x:Name="LayoutRoot" Background="White"> <Grid Background="AliceBlue" HorizontalAlignment="Left" Height="100" Margin="206,47,0,0" VerticalAlignment="Top" Width="400"> <StackPanel x:Name="spImages" Orientation="Horizontal" VerticalAlignment="Stretch" Width="900"> <StackPanel.RenderTransform> <TransformGroup> <TranslateTransform X="0"></TranslateTransform> </TransformGroup> </StackPanel.RenderTransform> <Image Width="100" Height="100" Source="Image/1.jpg" Stretch="Fill"/> <Image Width="100" Height="100" Source="Image/2.jpg" Stretch="Fill"/> <Image Width="100" Height="100" Source="Image/3.jpg" Stretch="Fill"/> <Image Width="100" Height="100" Source="Image/4.jpg" Stretch="Fill"/> <Image Width="100" Height="100" Source="Image/5.jpg" Stretch="Fill"/> <Image Width="100" Height="100" Source="Image/6.jpg" Stretch="Fill"/> <Image Width="100" Height="100" Source="Image/7.jpg" Stretch="Fill"/> <Image Width="100" Height="100" Source="Image/8.jpg" Stretch="Fill"/> <Button Content="Button" Width="75"/> </StackPanel> </Grid> <Button Content="上一张" HorizontalAlignment="Left" Margin="531,181,0,0" VerticalAlignment="Top" Width="75"/> <Button Content="下一张" HorizontalAlignment="Left" Margin="206,181,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_1"/> </Grid>
后台
private void Button_Click_1(object sender, RoutedEventArgs e) { Storyboard storyBoard = new Storyboard(); //设置动画轨迹 DoubleAnimation doubleAnimation = new DoubleAnimation(); //执行时间 doubleAnimation.Duration = new Duration(TimeSpan.FromMilliseconds(500)); //变量大小 doubleAnimation.To = -100; //绑定执行动画的对象 Storyboard.SetTarget(doubleAnimation, this.spImages); //设置执行动画的属性 Storyboard.SetTargetProperty(doubleAnimation, new PropertyPath("(UIElement.RenderTransform).(TransformGroup.Children)[0].(TranslateTransform.X)")); //添加动画 storyBoard.Children.Add(doubleAnimation); //执行动画 storyBoard.Begin(); }
- Silverlight滑动动画
- Silverlight动画
- silverlight动画
- silverlight 动画
- 滑动动画
- silverlight第一个动画
- Silverlight 2.0动画相关
- Silverlight 动画与定时器
- silverlight精要--动画效果
- silverlight 动画自管理
- Silverlight 动画类
- Silverlight 中的利萨茹动画
- silverlight动画行为
- silverlight加载动画
- silverlight 实现动画效果
- Silverlight 动画效果2
- Silverlight 旋转动画效果
- Silverlight 动画示例
- vnc复制与禁止
- iPhone开发关于UDID和UUID的一些理解
- EditPlus实现SQL语法高亮
- 使用getGenericSuperclass()和getActualTypeArguments()将DAO做成泛型
- java 序列化 serializable 接口--详解!
- Silverlight滑动动画
- android TP实现距离感应
- STL备忘录(转载)
- cvGoodFeaturesToTrack
- Linux学习之道:bash脚本
- SVN:分支合并到主干
- android 彻底关闭应用程序
- android 获取地图中心点的经纬度坐标
- ubuntu 无线 网络已被禁用 解决办法