1.实现翻页动画
namespace SilverlightForPractice.Storage
{
public class StoryboardHelper
{
public static void BeginPageAnimation(UIElement uiElement,double rotationY=180, int durationSeconds=2)
{
if (uiElement != null)
{
PlaneProjection planeProjection= new PlaneProjection() { RotationY = rotationY, CenterOfRotationY = 0, CenterOfRotationX = 0, CenterOfRotationZ = 0 };
uiElement.Projection = planeProjection;
Storyboard storyboard = new Storyboard();
DoubleAnimation da = new DoubleAnimation();
da.Duration = new TimeSpan(0, 0, durationSeconds);
da.From = rotationY;
da.To=0;
storyboard.Children.Add(da);
Storyboard.SetTarget(da, planeProjection);
Storyboard.SetTargetProperty(da, new PropertyPath(PlaneProjection.RotationYProperty));
storyboard.Begin();
}
}
}
}