public void Screen_Loaded(object sender, RoutedEventArgs e) { ColorAnimation animation; animation = new ColorAnimation(); animation.To = Colors.Transparent; animation.Duration = new Duration(TimeSpan.FromSeconds(0.5)); animation.AutoReverse = true; animation.RepeatBehavior = RepeatBehavior.Forever; PressAnyKeyTextBlockBrush.BeginAnimation(SolidColorBrush.ColorProperty, animation); }
public void Flash_Text(EventHandler callback) { ColorAnimation animation; animation = new ColorAnimation(); animation.To = Colors.Transparent; animation.Duration = new Duration(TimeSpan.FromSeconds(0.05)); animation.AutoReverse = true; animation.RepeatBehavior = new RepeatBehavior(3); animation.Completed += callback; PressAnyKeyTextBlockBrush.BeginAnimation(SolidColorBrush.ColorProperty, animation); }