//'movie' is the MediaElement and 'rect' is the white Rectangle that appears after the movie is finished and fades out private void movie_MediaEnded(object sender, RoutedEventArgs e) { movie.Opacity = 0.0; rect.Opacity = 1.0; Storyboard fadeOut = new Storyboard(); fadeOut.Completed += new EventHandler(fadeOut_Completed); DoubleAnimation fadeOutAnimation = new DoubleAnimation { Duration = TimeSpan.FromSeconds(1), To = 0.0 }; Storyboard.SetTargetProperty(fadeOutAnimation, new PropertyPath("Opacity")); fadeOut.Children.Add(fadeOutAnimation); fadeOut.Begin(rect); } void fadeOut_Completed(object sender, EventArgs e) { rect.Visibility = Visibility.Collapsed; movie.Visibility = Visibility.Collapsed; }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)