Slow and steady Silverlight (11)

Source: Internet
Author: User
Tags xmlns silverlight

Slow and steady Silverlight (11)-2.0 animation coloranimation,doubleanimation,pointanimation, interpolation key frame animation

Introduced

Silverlight 2.0 Animation:

ColorAnimation-linear interpolation animation between two Color values

DoubleAnimation-linear interpolation animation between two Double values

PointAnimation-linear interpolation animation between two point values

Interpolation Keyframe Animation-inserts key frames in a Color or Double or point animation to do linear, discrete, three-time Bezier curve animation

Dynamically changing animations-dynamically changing animations by program control

Online Demo

Http://www.cnblogs.com/webabcd/archive/2008/10/09/1307486.html

Example

1, Coloranimation.xaml

<usercontrol x:class= "Silverlight20.Animation.ColorAnimation"
Xmlns= "Http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x= "Http://schemas.microsoft.com/winfx/2006/xaml" >
<stackpanel horizontalalignment= "Left" >

<ellipse x:name= "Ellipse" fill= "Red" width= ">" height= "
<Ellipse.Triggers>

<!--
RoutedEvent-routed event for the owning object, only loaded this event
-->
<eventtrigger routedevent= "ellipse.loaded" >
<beginstoryboard x:name= "BeginStoryboard" >
<storyboard x:name= "Storyboard" >

<!--coloranimation-linear interpolation animation between two Color values-->
<!--
Storyboard.TargetName-The name of the object to animate
Storyboard.TargetProperty-Properties of the object to animate
BeginTime-the timeline will not start playing until the begintime time is triggered
TimeSpan-[-][Day.] When: minutes: seconds [. 1 digits to 7 seconds after the decimal] (can be positive; can be negative; nullable; default is 0)
From-Animation starting value
To-animation end value
By-animation starts from the starting value, the total amount of change required (to precedence by by)
Duration-Timeline Duration
TimeSpan-[-][Day.] When: minutes: seconds [. 1 digits to 7 seconds after the decimal]
Automatic-Automatic determination
Forever-Infinite length
AutoReverse-whether to return the original path after the animation completes. The default value is False
RepeatBehavior-time, times, or type of animation repeat playback
TimeSpan-[-][Day.] When: minutes: seconds [. 1 digits to 7 seconds after the decimal]
NX-Number of plays. 1x, 2x, 3x
Forever-Permanent Playback
SpeedRatio-A multiple of the rate of the timeline. Default value 1
Fillbehavior-Behavior after animation [System.Windows.Media.Animation.FillBehavior enum]
Fillbehavior.holdend-the end value of the animated property is retained after the animation finishes. Default value
Fillbehavior.stop-After the animation is finished, the Restore animation property is its initial value
-->
<coloranimation
Storyboard.targetname= "Ellipse"
Storyboard.targetproperty= "(Ellipse.fill). (Solidcolorbrush.color) "
Begintime= "00:00:0"
From= "Red"
To= "Yellow"
duration= "Automatic"
Autoreverse= "True"
repeatbehavior= "3x" >
</ColorAnimation>
</Storyboard>
</BeginStoryboard>
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>

</StackPanel>
</UserControl>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.