public override Task Disappearing(View content, PopupPage page)
        {
            if (!page.IsBackgroundAnimating)
            {
                return(null);
            }
            TaskCompletionSource <bool> task = new TaskCompletionSource <bool>();

            page.Animate("backgroundFade", d =>
            {
                page.BackgroundColor = GetColor(d);
            }, _backgroundColor.A, 0, length: BackgroundTime, finished: (d, b) =>
            {
                task.SetResult(true);
            });
            return(task.Task);
        }
Ejemplo n.º 2
0
        public override Task Appearing(View content, PopupPage page)
        {
            if (HasBackgroundAnimation && page.BackgroundImageSource == null)
            {
                TaskCompletionSource <bool> task = new TaskCompletionSource <bool>();
                page.Animate("backgroundFade", d =>
                {
                    page.BackgroundColor = GetColor(d);
                }, 0, _backgroundColor.A, length: DurationIn, finished: (d, b) =>
                {
                    task.SetResult(true);
                });

                return(task.Task);
            }

            return(Task.FromResult(0));
        }