public static void FadeIn(this UIElement targetControl) { DoubleAnimation fadeInAnimation = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromSeconds(1.5))); Storyboard.SetTarget(fadeInAnimation, targetControl); Storyboard.SetTargetProperty(fadeInAnimation, new PropertyPath(UIElement.OpacityProperty)); Storyboard sb = new Storyboard(); sb.Children.Add(fadeInAnimation); sb.Begin(); }
public partial class childWindow1 : Window { public childWindow1() { InitializeComponent(); this.FadeIn(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)