PageRenderTime 5ms CodeModel.GetById 1ms app.highlight 1ms RepoModel.GetById 1ms app.codeStats 0ms

/Visual Studio 2008/VBSL3Animation/ReadMe.txt

#
Plain Text | 85 lines | 58 code | 27 blank | 0 comment | 0 complexity | 0fe90caaa52d3a12697c48afaa12bb33 MD5 | raw file
 1========================================================================
 2    SILVERLIGHT APPLICATION : VBSL3Animation Project Overview
 3========================================================================
 4
 5/////////////////////////////////////////////////////////////////////////////
 6Use:
 7
 8This example illustrates how to play animation in Silverlight. Since animation
 9is a big topic, we only covers PointAnimation in this sample. For other animation
10classes, the code should be similar.
11
12
13/////////////////////////////////////////////////////////////////////////////
14Prerequisites:
15
16Silverlight 3 Tools for Visual Studio 2008 SP1
17http://www.microsoft.com/downloads/details.aspx?familyid=9442b0f2-7465-417a-88f3-5e7b5409e9dd&displaylang=en
18
19Silverilght 3 runtime:
20http://silverlight.net/getstarted/
21
22
23/////////////////////////////////////////////////////////////////////////////
24Code Logic:
25
261. MainPage.xaml:
27
28It is the container of the following UserControls:
29BasicPointAnimation.xaml
30AnimateDependencyProperty.xaml
31Easing.xaml
32CodeBehindCreation.xaml
33UsingKeyFrames.xaml
34
352. BasicPointAnimation.xaml:
36
37It shows how to write baisc PointAnimation for an EllipseGeometry. In the
38MouseLeftButtonDown event of MyStackPanel, current mouse position is got and the
39To property of PointAnimation object is updated. After that, call Begin() method
40of the StoryBoard object to play animation.
41
423. MyEllipse.xaml:
43
44This UserControl is used to wrap a EllipseGeometry. EllipseGeometry doesn't
45expose any event for its Center change. So to get a notification after Center
46change EllipseCenterProperty is added. A callback method is hooked so that whenever
47the EllipseCenterProperty is changed we can synchronize the changed value with the
48Center property of EllipseGeometry object, in which way to update UI.
49
504. AnimateDependencyProperty.xaml
51
52This UserControl uses MyEllipse UserControl. The TargetProperty of the StoryBoard
53in it is the EllipseCenterProperty of MyEllipse object. During the animation, the
54EllipseCenterProperty will be changed and the callback method MyHandler() will be 
55called, which in turn calls OnEllipseCenterChanged() method to trigger the 
56EllipseCenterChanged event. The EllipseCenterChanged event is public so we can hook
57event handler in AnimateDependencyProperty UserControl to get a notification for 
58EllipseCenterProperty's change. In this sample, a Line object is updated in this
59event handler to simulate an animation effect.
60
615. Easing.xaml
62
63This UserControl demonstrates how to use built-in Ease classes and how to write a
64custom Ease class. By inheriting EasingFunctionBase and override its EaseInCore()
65method we can write our own Ease class.
66
676. CodeBehindCreation.xaml
68
69This UserControl shows how to initialize a Storyboard in code behind. The final effect
70is the same as BasicPointAnimation.xaml, which uses XAML to add Storyboard.
71
727. UsingKeyFrames.xaml
73
74This UserControl shows how to create KeyFrames based animation in Silverlight.
75In the sample SplineDoubleKeyFrame is used to specify each KeyFrame.
76
77
78/////////////////////////////////////////////////////////////////////////////
79References:
80
81Animation
82http://msdn.microsoft.com/en-us/library/cc189090(VS.95).aspx
83
84
85/////////////////////////////////////////////////////////////////////////////