Ejemplo n.º 1
0
        /// <summary>
        /// Begins the transition.
        /// </summary>
        /// <param name="transitionElement">The transition element.</param>
        /// <param name="oldContent">The old content.</param>
        /// <param name="newContent">The new content.</param>
        public virtual void BeginTransition(TransitionPresenter transitionElement, UIElement oldContent, UIElement newContent)
        {
            var sb = new Storyboard();
            var animation = CreateFadeOutAnimation(oldContent);

            sb.Children.Add(animation);
            sb.Duration = FadeLength;

            sb.Completed +=
                (s, e) =>
                    {
                        sb.Stop();
                        transitionElement.TransitionEnded(oldContent);
                    };

            sb.Begin();
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Begins the transition.
        /// </summary>
        /// <param name="transitionElement">The transition element.</param>
        /// <param name="oldContent">The old content.</param>
        /// <param name="newContent">The new content.</param>
        public void BeginTransition(TransitionPresenter transitionElement, UIElement oldContent, UIElement newContent)
        {
            transitionElement.Children.Clear();
            transitionElement.Children.Add(newContent);

            var sb = new Storyboard();
            var animation = CreateFadeInAnimation(newContent);

            sb.Children.Add(animation);
            sb.Duration = _fadeLength;

            newContent.Opacity = 0;

            sb.Completed +=
                (s, e) =>
                    {
                        sb.Stop();
                        newContent.Opacity = 1;
                    };

            sb.Begin();
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Begins the transition.
        /// </summary>
        /// <param name="transitionElement">The transition element.</param>
        /// <param name="oldContent">The old content.</param>
        /// <param name="newContent">The new content.</param>
        public void BeginTransition(TransitionPresenter transitionElement, UIElement oldContent, UIElement newContent)
        {
            var sb = new Storyboard
                         {
                             Duration = _swipLength
                         };

            Canvas.SetLeft(newContent, Configuration.InternalResolution.Width);

            var animation = CreateSwipAnimation(newContent);
            sb.Children.Add(animation);

            sb.Completed +=
                (s, e) =>
                    {
                        sb.Stop();
                        transitionElement.TransitionEnded(oldContent);
                        Canvas.SetLeft(newContent, 0);
                    };

            sb.Begin();
        }