public CoverFlow() { DefaultStyleKey = typeof(CoverFlow); items = new List<CoverFlowItem>(); SingleItemDuration = new Duration(TimeSpan.FromMilliseconds(600)); PageDuration = new Duration(TimeSpan.FromMilliseconds(900)); duration = SingleItemDuration; EasingFunction = new CubicEase(); }
void initanimationproperties() { _panelstory = new Windows.UI.Xaml.Media.Animation.Storyboard(); _panelanimation = new Windows.UI.Xaml.Media.Animation.DoubleAnimation(); _panelanimation.Duration = TimeSpan.FromMilliseconds(600); //1000 _panelstory.Children.Add(_panelanimation); Windows.UI.Xaml.Media.Animation.CubicEase ease1 = new Windows.UI.Xaml.Media.Animation.CubicEase(); ease1.EasingMode = Windows.UI.Xaml.Media.Animation.EasingMode.EaseOut; _panelanimation.EasingFunction = ease1; Windows.UI.Xaml.Media.Animation.Storyboard.SetTargetProperty(_panelanimation, "TranslateX"); Windows.UI.Xaml.Media.Animation.Storyboard.SetTarget(_panelanimation, _paneltransform); _panelstory.Completed += Storyboard_Completed_1; }
void animateimage(double to, int index) { Windows.UI.Xaml.Media.Animation.Storyboard story = new Windows.UI.Xaml.Media.Animation.Storyboard(); Windows.UI.Xaml.Media.Animation.DoubleAnimation animation = new Windows.UI.Xaml.Media.Animation.DoubleAnimation(); animation.Duration = TimeSpan.FromMilliseconds(650); story.Children.Add(animation); Windows.UI.Xaml.Media.Animation.CubicEase ease1 = new Windows.UI.Xaml.Media.Animation.CubicEase(); //ease1.EasingMode = Windows.UI.Xaml.Media.Animation.EasingMode.EaseIn ; animation.EnableDependentAnimation = true; animation.EasingFunction = ease1; animation.To = to; Windows.UI.Xaml.Media.Animation.Storyboard.SetTargetProperty(animation, "Opacity"); Windows.UI.Xaml.Media.Animation.Storyboard.SetTarget(animation, _imagelist[index]); story.Begin(); }
public CircularRatingControl() { InitializeComponent(); Angle = (150 * 360) / 100; RenderArc(); DoubleAnimation animation = new DoubleAnimation(); animation.From = 0; animation.To = Percentage; animation.Duration = new Duration(TimeSpan.FromSeconds(1)); CubicEase easingFunction = new CubicEase(); easingFunction.EasingMode = EasingMode.EaseOut; animation.EasingFunction = easingFunction; animation.AutoReverse = false; Storyboard storyboard = new Storyboard(); storyboard.Children.Add(animation); animation.EnableDependentAnimation = true; Storyboard.SetTarget(animation, this); Storyboard.SetTargetProperty(animation, "Percentage"); storyboard.Begin(); }
void initlogo() { _logotransform = new CompositeTransform() ; _logogrid = new Grid() { Width = 210, Height=210, RenderTransform = _logotransform}; this.Children.Add(_logogrid); Image img = new Image(); BitmapImage bitmapImage = new BitmapImage(); bitmapImage.UriSource = new Uri("ms-appx:///Resources/logo.png", UriKind.Absolute); img.Source = bitmapImage; _logogrid.Children.Add(img); Storyboard logo_story = new Storyboard(); CubicEase ease = new CubicEase() { EasingMode = EasingMode.EaseIn }; DoubleAnimation logo_animx = new DoubleAnimation() { Duration = TimeSpan.FromMilliseconds(600), EnableDependentAnimation =true, EasingFunction =ease }; DoubleAnimation logo_animy = new DoubleAnimation() { Duration = TimeSpan.FromMilliseconds(600), EnableDependentAnimation = true, EasingFunction = ease }; DoubleAnimation logo_scalex = new DoubleAnimation() { Duration = TimeSpan.FromMilliseconds(600), EnableDependentAnimation = true, EasingFunction = ease }; DoubleAnimation logo_scaley = new DoubleAnimation() { Duration = TimeSpan.FromMilliseconds(600), EnableDependentAnimation = true, EasingFunction = ease }; logo_story.Children.Add(logo_animx); logo_story.Children.Add(logo_animy); logo_story.Children.Add(logo_scalex); logo_story.Children.Add(logo_scaley); Storyboard.SetTarget(logo_animx, _logotransform); Storyboard.SetTargetProperty(logo_animx, "TranslateX"); Storyboard.SetTarget(logo_animy, _logotransform); Storyboard.SetTargetProperty(logo_animy, "TranslateY"); Storyboard.SetTarget(logo_scalex, _logotransform); Storyboard.SetTargetProperty(logo_scalex, "ScaleX"); Storyboard.SetTarget(logo_scaley, _logotransform); Storyboard.SetTargetProperty(logo_scaley, "ScaleY"); logo_animx.To = -560.0; logo_animy.To = 400.0; logo_scalex.To = 0.35; logo_scaley.To = 0.35; logo_story.Completed += logo_story_Completed; logo_story.Begin(); }
//Get Easing Function private EasingFunctionBase GetEasingFunction(Easing type) { EasingFunctionBase func = null; switch (type) { case Easing.EaseSineIn: case Easing.EaseSineOut: case Easing.EaseSineInOut: func = new SineEase(); break; case Easing.EaseCircleIn: case Easing.EaseCircleOut: case Easing.EaseCircleInOut: func = new CircleEase(); break; case Easing.EaseQuadraticIn: case Easing.EaseQuadraticOut: case Easing.EaseQuadraticInOut: func = new QuadraticEase(); break; case Easing.EaseCubicIn: case Easing.EaseCubicOut: case Easing.EaseCubicInOut: func = new CubicEase(); break; case Easing.EaseQuarticIn: case Easing.EaseQuarticOut: case Easing.EaseQuarticInOut: func = new QuarticEase(); break; case Easing.EaseQuinticIn: case Easing.EaseQuinticOut: case Easing.EaseQuinticInOut: func = new QuinticEase(); break; case Easing.EaseBackIn: case Easing.EaseBackOut: case Easing.EaseBackInOut: func = new BackEase(); break; case Easing.EaseBounceIn: case Easing.EaseBounceOut: case Easing.EaseBounceInOut: func = new BounceEase(); break; case Easing.EaseElasticIn: case Easing.EaseElasticOut: case Easing.EaseElasticInOut: func = new ElasticEase(); break; case Easing.EaseExpoIn: case Easing.EaseExpoOut: case Easing.EaseExpoInOut: func = new ExponentialEase(); break; case Easing.EasePowerIn: case Easing.EasePowerOut: case Easing.EasePowerInOut: func = new PowerEase(); break; default: break; } if (func != null) { switch ((int)type % 3) { case 0: func.EasingMode = EasingMode.EaseIn; break; case 1: func.EasingMode = EasingMode.EaseOut; break; default: func.EasingMode = EasingMode.EaseInOut; break; } } return func; }