コード例 #1
0
ファイル: FadeOut.cs プロジェクト: ernstnaezer/Manssiere
        /// <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();
            var animation = CreateFadeOutAnimation(oldContent);

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

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

            sb.Begin();
        }
コード例 #2
0
ファイル: Swipe.cs プロジェクト: ernstnaezer/Manssiere
        /// <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();
        }