Ejemplo n.º 1
0
        private void ShowText(string text)
        {
            var anima1 = new DoubleAnimation()
            {
                To       = 0,
                Duration = TimeSpan.FromSeconds(0.1),
            };

            anima1.Completed += delegate
            {
                TxtBlock.Text = text;
                var anima2 = new DoubleAnimation()
                {
                    To       = 1,
                    Duration = TimeSpan.FromSeconds(0.1),
                };
                TxtBlock.BeginAnimation(OpacityProperty, anima2);
            };
            TxtBlock.BeginAnimation(OpacityProperty, anima1);
        }
Ejemplo n.º 2
0
        public new void Show()
        {
            base.Show();
            var anim = new DoubleAnimation
            {
                From     = Opacity,
                To       = 0,
                Duration = new Duration(TimeSpan.FromSeconds(3))
            };

            anim.Completed += Anim_Completed;
            BeginAnimation(OpacityProperty, anim);

            var animt = new DoubleAnimation
            {
                From     = TxtBlock.Opacity,
                To       = 0.2,
                Duration = new Duration(TimeSpan.FromSeconds(3))
            };

            TxtBlock.BeginAnimation(OpacityProperty, animt);
        }
Ejemplo n.º 3
0
 private void BtnClear_Click(object sender, RoutedEventArgs e)
 {
     TxtBlock.Clear();
 }