Exemplo n.º 1
0
        private void TransitionOut()
        {
            var opacityTask = OpacityGrid
                              .Fade(1, 0).Then()
                              .Fade(1, 500).Then()
                              .Fade(0, 1500)
                              .StartAsync();
            var blurTask = BlurGrid
                           .Blur(50, 1000, easingType: EasingType.Quadratic, easingMode: Windows.UI.Xaml.Media.Animation.EasingMode.EaseInOut).Then()
                           .Blur(0, 1000, easingType: EasingType.Quadratic, easingMode: Windows.UI.Xaml.Media.Animation.EasingMode.EaseInOut)
                           .StartAsync();

            _transitionOutTask = Task.WhenAll(opacityTask, blurTask).ContinueWith(async(t) =>
            {
                await Dispatcher.RunAsync(Windows.UI.Core.CoreDispatcherPriority.Normal,
                                          () =>
                {
                    if (VideoControl?.MediaPlayer != null)
                    {
                        VideoControl.Deactivate();
                        ImageControl.UriSource = null;
                    }
                });
            });
        }