zoukankan
html css js c++ java
WPF(1)Hello,WPF
以下是一段简单的say hello动画,说是简单,可自己也费了九牛之力啊
在Kaxaml中编辑, 用Xaml Hack 也可打开查看效果。由于对一些语法,属性还不熟悉,所以得借助Kaxaml所带的提示功能,比较郁闷的是这软件有时会因一些语法错误而导致直接退出
<
Page
xmlns
=
"
http://schemas.microsoft.com/winfx/2006/xaml/presentation
"
xmlns:x
=
"
http://schemas.microsoft.com/winfx/2006/xaml
"
>
<
Canvas
>
<
Canvas.Triggers
>
<
EventTrigger RoutedEvent
=
"
Canvas.Loaded
"
>
<
EventTrigger.Actions
>
<
BeginStoryboard
>
<
Storyboard BeginTime
=
"
0
"
Duration
=
"
Forever
"
>
<!--
"
hello
"
Animation
-->
<
DoubleAnimation Storyboard.TargetName
=
"
hello
"
Storyboard.TargetProperty
=
"
(Canvas.Left)
"
From
=
"
0
"
To
=
"
500
"
BeginTime
=
"
0:0:0
"
Duration
=
"
0:0:1.5
"
/>
<
DoubleAnimation Storyboard.TargetName
=
"
skew
"
Storyboard.TargetProperty
=
"
AngleX
"
AutoReverse
=
"
True
"
DecelerationRatio
=
"
0.5
"
From
=
"
0
"
To
=
"
30
"
BeginTime
=
"
0:0:1
"
Duration
=
"
0:0:0.8
"
/>
<
DoubleAnimation Storyboard.TargetName
=
"
hello
"
Storyboard.TargetProperty
=
"
(Canvas.Left)
"
To
=
"
300
"
BeginTime
=
"
0:0:3
"
Duration
=
"
0:0:0.5
"
/>
<!--
"
W
"
Animation
-->
<
DoubleAnimation Storyboard.TargetName
=
"
tbw
"
Storyboard.TargetProperty
=
"
(Canvas.Left)
"
From
=
"
350
"
To
=
"
550
"
BeginTime
=
"
0:0:3
"
Duration
=
"
0:0:0.35
"
/>
<
DoubleAnimation Storyboard.TargetName
=
"
tbw
"
Storyboard.TargetProperty
=
"
(Canvas.Top)
"
From
=
"
0
"
To
=
"
180
"
BeginTime
=
"
0:0:3
"
Duration
=
"
0:0:00.35
"
/>
<!--
"
P
"
Animation
-->
<
DoubleAnimation Storyboard.TargetName
=
"
tbp
"
Storyboard.TargetProperty
=
"
(Canvas.Left)
"
From
=
"
400
"
To
=
"
700
"
BeginTime
=
"
0:0:3.5
"
Duration
=
"
0:0:0.3
"
/>
<
DoubleAnimation Storyboard.TargetName
=
"
tbp
"
Storyboard.TargetProperty
=
"
(Canvas.Top)
"
From
=
"
0
"
To
=
"
180
"
BeginTime
=
"
0:0:3.5
"
Duration
=
"
0:0:0.3
"
/>
<!--
"
F
"
Animation
-->
<
DoubleAnimation Storyboard.TargetName
=
"
tbf
"
Storyboard.TargetProperty
=
"
(Canvas.Left)
"
From
=
"
450
"
To
=
"
800
"
BeginTime
=
"
0:0:4
"
Duration
=
"
0:0:0.3
"
/>
<
DoubleAnimation Storyboard.TargetName
=
"
tbf
"
Storyboard.TargetProperty
=
"
(Canvas.Top)
"
From
=
"
0
"
To
=
"
180
"
BeginTime
=
"
0:0:4
"
Duration
=
"
0:0:0.3
"
/>
</
Storyboard
>
</
BeginStoryboard
>
</
EventTrigger.Actions
>
</
EventTrigger
>
</
Canvas.Triggers
><!--
Insert
this
sample
as
the child of a Page, Grid, Canvas, Button, or other container
-->
<
TextBlock x:Name
=
"
hello
"
Canvas.Top
=
"
218
"
FontFamily
=
"
Segoe, Segoe UI, Arial
"
FontWeight
=
"
Bold
"
FontSize
=
"
80pt
"
Foreground
=
"
Chartreuse
"
Text
=
"
Hello
"
>
<
TextBlock.RenderTransform
>
<
SkewTransform x:Name
=
"
skew
"
CenterX
=
"
50
"
CenterY
=
"
200
"
>
</
SkewTransform
>
</
TextBlock.RenderTransform
>
</
TextBlock
>
<
TextBlock x:Name
=
"
tbw
"
Text
=
"
W
"
FontSize
=
"
100pt
"
FontWeight
=
"
Bold
"
Canvas.Top
=
"
-1000
"
></
TextBlock
>
<
TextBlock x:Name
=
"
tbp
"
Text
=
"
P
"
FontSize
=
"
100pt
"
FontWeight
=
"
Bold
"
Canvas.Top
=
"
-1000
"
>
</
TextBlock
>
<
TextBlock x:Name
=
"
tbf
"
Text
=
"
F
"
FontSize
=
"
100pt
"
FontWeight
=
"
Bold
"
Canvas.Top
=
"
-1000
"
>
</
TextBlock
>
</
Canvas
>
</
Page
>
查看全文
相关阅读:
iOS 109个Demo范例
iOS 109个Demo范例
iOS 完全复制UIView
iOS 完全复制UIView
iOS 获取self类型
Python 进阶_OOP 面向对象编程_类和继承
Python 进阶_OOP 面向对象编程_类和继承
Python 进阶_模块 & 包
Python 进阶_模块 & 包
Python 进阶_模块 & 包
原文地址:https://www.cnblogs.com/anders06/p/1151512.html
最新文章
Linux下汇编语言学习笔记5 ---
Linux下汇编语言学习笔记4 ---
Linux下汇编语言学习笔记2 ---
Linux下汇编语言学习笔记3 ---
Linux下汇编语言学习笔记1 ---
Linux下汇编语言学习笔记0 --- 前期准备工作
Arduino学习笔记77
Arduino学习笔记76
Arduino学习笔记75
Arduino学习笔记74
热门文章
Arduino学习笔记73
Arduino学习笔记71
Arduino学习笔记72
Arduino学习笔记70
Arduino学习笔记67
objective-c: Functions and static keyword
Effective Objective-C [下]
Effective Objective-C [上]
Effective Objective-C [上]
Effective Objective-C 2.0
Copyright © 2011-2022 走看看