Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System;
- using System.Windows;
- using System.Windows.Controls;
- using System.Windows.Media;
- using System.Windows.Media.Animation;
- using System.Windows.Media.Effects;
- namespace EffectsExample
- {
- class Program
- {
- [STAThread]
- public static void Main()
- {
- var window = new Window();
- var viewbox = new Viewbox();
- var oldText = new TextBlock();
- var text = new TextBlock();
- var effect = new TransitionEffects.BandedSwirlTransitionEffect();
- var animation = new DoubleAnimation(0, 1, new Duration(TimeSpan.FromSeconds(5)));
- animation.RepeatBehavior = RepeatBehavior.Forever;
- animation.AutoReverse = true;
- viewbox.Stretch = Stretch.Fill;
- oldText.Background = Brushes.DeepSkyBlue;
- oldText.Foreground = Brushes.White;
- oldText.Text = "Hello, world!";
- text.Background = Brushes.White;
- text.Foreground = Brushes.DeepSkyBlue;
- text.Text = "Hello, world!";
- text.Effect = effect;
- viewbox.Child = text;
- window.Content = viewbox;
- effect.OldImage = new VisualBrush(oldText);
- effect.BeginAnimation(TransitionEffects.RandomCircleRevealTransitionEffect.ProgressProperty, animation);
- new Application().Run(window);
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement