示例#1
0
        public async Task Appearing(View content, PopupPage page)
        {
            var taskList = new List <Task>();

            if (content != null)
            {
                taskList.Add(content.TranslateTo(content.TranslationX, 0, Duration, EasingIn));
                taskList.Add(page.ColorTo(page.BackgroundColor, Color.Black.MultiplyAlpha(0.2),
                                          color => page.BackgroundColor = color, Duration, EasingOut));
            }

            ;

            if (_previous?.Content != null)
            {
                taskList.Add(_previous.Content.ScaleTo(0.96, Duration, EasingOut));
                taskList.Add(_previous.Content.TranslateTo(0, -25, Duration, EasingOut));
                if (content != null)
                {
                    content.Margin = new Thickness(content.Margin.Left,
                                                   content.Margin.Top,
                                                   content.Margin.Right,
                                                   content.Margin.Bottom);
                }

                //taskList.Add(page.ColorTo(page.BackgroundColor, Colors.PopupBlack,
                //color => page.BackgroundColor = color, Duration, EasingOut));
            }

            page.IsVisible = true;

            await Task.WhenAll(taskList);
        }
示例#2
0
        public async Task Disappearing(View content, PopupPage page)
        {
            var taskList = new List <Task>();

            if (content != null)
            {
                taskList.Add(content.TranslateTo(content.TranslationX, translationHeight,
                                                 Duration, EasingOut));
                taskList.Add(page.ColorTo(page.BackgroundColor, Color.Black.MultiplyAlpha(0),
                                          color => page.BackgroundColor = color, Duration, EasingOut));
            }

            ;
            if (_previous?.Content != null)
            {
                if (content != null)
                {
                    taskList.Add(_previous.Content.TranslateTo(0, 0, Duration, EasingIn));
                }
                taskList.Add(_previous.Content.ScaleTo(1, Duration, EasingIn));
                //taskList.Add(page.ColorTo(page.BackgroundColor, Color.Transparent,
                //color => page.BackgroundColor = color, Duration, EasingIn));
            }

            await Task.WhenAll(taskList);
        }