예제 #1
0
        /// <summary>
        /// Animation to flip and fade out a page to the left
        /// </summary>
        /// <param name="page">The page to animate</param>
        /// <param name="seconds">The time of the animation</param>
        /// <returns></returns>
        public static async Task FlipAndFadeOut(this Page page, float flipSeconds)
        {
            // Creates the storyboard
            var sb = new Storyboard();

            // Add flip out animation on the horizontal line
            sb.AddFlipOutX(flipSeconds, -120);

            // Add flip out animation on the vertical line
            sb.AddFlipOutY(flipSeconds, -120);

            // Add fade out animation
            sb.AddFadeOut(flipSeconds);

            // Start animating
            sb.Begin(page);

            // Make page visible
            page.Visibility = Visibility.Visible;

            // Wait for it to finish
            await Task.Delay((int)(flipSeconds * 1000));
        }