Create Scale Y Effects - CSharp Windows.UI.Xaml.Media.Animation

CSharp examples for Windows.UI.Xaml.Media.Animation:Animation

Description

Create Scale Y Effects

Demo Code


using Windows.UI.Xaml.Media.Animation;
using Windows.UI.Xaml;
using Windows.UI;
using System;//from   w w w .  j av a 2  s.  c  o  m

public class Main{
        public static Storyboard CreateScaleYEffects(DependencyObject target, TimeSpan beginTime, TimeSpan duration, double from = 0, double to = 1, EasingFunctionBase easing = null)
        {
            var t1 = new DoubleAnimation
            {
                BeginTime = beginTime,
                Duration = duration,
                From = from,
                To = to,
                EasingFunction = easing
            };

            Storyboard.SetTarget(t1, target);
            Storyboard.SetTargetProperty(t1, "(UIElement.RenderTransform).(CompositeTransform.ScaleY)");
            var sb = new Storyboard();
            sb.Children.Add(t1);
            return sb;
        }
}

Related Tutorials