Пример #1
0
        public static async Task SlideAndFadeOutToLeftAsync(this FrameworkElement element, float seconds = 0.3f, bool keepMargin = true, int width = 0)
        {
            var storyBoard = new Storyboard();

            storyBoard.RemoveSlideToLeft(seconds, width == 0 ? element.ActualWidth : width, keepMargin: keepMargin);
            storyBoard.AddFadeOutAugment(seconds);
            storyBoard.Begin(element);
            element.Visibility = Visibility.Visible;
            await Task.Delay((int)seconds * 1000);
        }
Пример #2
0
        public static async Task SlideAndFadeOutToRightAsync(this Page page, float seconds, bool keepMargin = true)
        {
            var storyBoard = new Storyboard();

            storyBoard.RemoveSlideToRight(seconds, page.WindowWidth, keepMargin: keepMargin);
            storyBoard.AddFadeOutAugment(seconds);
            storyBoard.Begin(page);
            page.Visibility = Visibility.Visible;
            await Task.Delay((int)seconds * 1000);
        }