Animate Opacity From 0 to 1 - CSharp Windows.UI.Xaml.Media.Animation

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

Description

Animate Opacity From 0 to 1

Demo Code


using System.Windows.Media.Animation;
using System.Windows;
using System.Threading.Tasks;
using System.Text;
using System.Linq;
using System.Collections.Generic;
using System;//from   w w  w .ja v a2s .  c  o  m

public class Main{
        public static AnimationTimeline OpacityFrom0to1(int seconds)
      {
         DoubleAnimation animation = new DoubleAnimation();
         animation.From = 0.0;
         animation.To = 1.0;
         animation.Duration = new Duration(TimeSpan.FromSeconds(seconds));

         return animation;
      }
}

Related Tutorials