Ejemplo n.º 1
0
        private void FadeOutEffect()
        {
            Action onFadeEnded;
            if (CurrentEffect == null || CurrentEffect.Next == null)
            {
                onFadeEnded = RemoveEffect;
            }
            else
            {
                var next = CurrentEffect.Next;
                var delay = CurrentEffect.Delay;
                onFadeEnded = delegate
                {
                    RemoveEffect();
                    PlayEffect(next, delay);
                };
            }

            var animation = new FadeAnimation(this, 0, CurrentEffect.FadeDuration, onFadeEnded);
            IsFading = true;
            EffectPanel.BeginAnimation(Panel.OpacityProperty, animation);
        }
Ejemplo n.º 2
0
 private void FadeInEffect(double duration)
 {
     var animation = new FadeAnimation(this, 1, duration, delegate { IsFading = false; });
     IsFading = true;
     EffectPanel.BeginAnimation(Panel.OpacityProperty, animation);
 }