zoukankan
html css js c++ java
WPF : StoryBoard用法
Storyboard storyBoard
=
new
Storyboard();
DoubleAnimation ani
=
new
DoubleAnimation();
ani.From
=
0
;
ani.To
=
360
;
ani.Duration
=
new
Duration(TimeSpan.FromMilliseconds(
5000
));
ani.RepeatBehavior
=
RepeatBehavior.Forever;
storyBoard.Children.Add(ani);
this
.RegisterName(
"
mRotationX
"
, mRotationX);
Storyboard.SetTargetName(ani,
"
mRotationX
"
);
Storyboard.SetTargetProperty(ani,
new
PropertyPath(AxisAngleRotation3D.AngleProperty));
storyBoard.Begin(
this, true
); /////true表示controlable
TimeSpan timeSpan
=
TimeSpan.FromMilliseconds(
250
);
//
创建一个Animation, 设置起点, 终点, 时段
DoubleAnimation ani
=
new
DoubleAnimation();
ani.From
=
4
;
ani.To
=
0
;
ani.Duration
=
new
Duration(timeSpan);
Storyboard.SetTargetName(ani,
"
Opacity
"
);
Storyboard.SetTargetProperty(ani,
new
PropertyPath(WindowMain.OpacityProperty));
//
创建一个Animation, 设置起点, 终点, 时段
DoubleAnimation ani2
=
new
DoubleAnimation();
ani2.From
=
this
.mZoomSlider.Value;
ani2.To
=
2
;
ani2.Duration
=
new
Duration(timeSpan);
Storyboard.SetTargetName(ani2,
"
Zoom
"
);
Storyboard.SetTargetProperty(ani2,
new
PropertyPath(Slider.ValueProperty));
//
创建StoryBoard
Storyboard storyBoard
=
new
Storyboard();
storyBoard.FillBehavior = FillBehavior.Stop;
storyBoard.Completed
+=
new
EventHandler(storyBoard_Completed);
storyBoard.Children.Add(ani);
storyBoard.Children.Add(ani2);
this
.RegisterName(
"
Opacity
"
,
this
);
this
.RegisterName(
"
Zoom
"
,
this
.mZoomSlider);
storyBoard.Begin(
this, true
); /////////////////////////////////true表示controlable
或者
<
Window.Triggers
>
<
EventTrigger RoutedEvent
=
"
Window.Loaded
"
>
<
BeginStoryboard
>
<
Storyboard Name
=
"
myStoryBoardX
"
>
<
DoubleAnimation
Storyboard.TargetName
=
"
rotationX
"
Storyboard.TargetProperty
=
"
Angle
"
From
=
"
0
"
To
=
"
360
"
Duration
=
"
0:0:15
"
RepeatBehavior
=
"
Forever
"
/>
</
Storyboard
>
</
BeginStoryboard
>
<
BeginStoryboard
>
<
Storyboard Name
=
"
myStoryBoardY
"
>
<
DoubleAnimation
Storyboard.TargetName
=
"
rotationY
"
Storyboard.TargetProperty
=
"
Angle
"
From
=
"
0
"
To
=
"
360
"
Duration
=
"
0:0:12
"
RepeatBehavior
=
"
Forever
"
/>
</
Storyboard
>
</
BeginStoryboard
>
</
EventTrigger
>
</
Window.Triggers
>
查看全文
相关阅读:
Eclipse中Outline里各种图标的含义
synchronized
instanceof
java代码实现rabbitMQ请求
ftp服务的搭建及调用
WebService学习总结(三)——使用JDK开发WebService
Java Web Service 学习
通俗理解阻塞、非阻塞,同步、异步。
mongo VUE 操作
【清华集训2014】主旋律
原文地址:https://www.cnblogs.com/mrfangzheng/p/1179712.html
最新文章
@pathVariable的作用
SpringMvc中@ModelAttribute注解的使用
springboot问题集(一)------junit内Assert.assertEquals()的含义
spring注解
spring boot 之热部署
同一sql表,在页面展示多级菜单
从0开始springboot
thymeleaf 学习笔记
Spring Boot @SpringApplicationConfiguration 不能导入的问题
HBase 入门
热门文章
Solr 集群
Spring boot starter地址
Spring boot 自定义starter
Spring boot 启动配置原理
Linux swap 使用
Spring boot 数据访问JDBC
JVM jstack 详解
Spring boot 注册Filter , Listener, Servlet
Spring boot 配置嵌入式Servlet容器
转Class.forName()用法详解
Copyright © 2011-2022 走看看