public void ShowPopup(PopupView view, Rectangle bounds, int padding)
        {
            wrapper = new Frame()
            {
                Content           = view,
                HasShadow         = view.HasShadow,
                BorderColor       = view.BorderColor,
                IsClippedToBounds = view.IsClippedToBounds,
                CornerRadius      = view.CornerRadius,
                Padding           = padding
            };
            ((IPopup)view).Parent       = this.layout;
            ((IPopup)view).ParentObject = this.wrapper;

            AbsoluteLayout.SetLayoutBounds(wrapper, bounds);
            AbsoluteLayout.SetLayoutFlags(wrapper, AbsoluteLayoutFlags.All);
            this.layout.Children.Add(wrapper);
            view.BindingContext = this.BindingContext;
            if (view.AnimateOpen)
            {
                wrapper.ScaleTo(0.99, 200).ContinueWith(async(t) =>
                {
                    await wrapper.ScaleTo(1, 200);
                });
            }
        }
示例#2
0
        public void ShowPopup(PopupView view, PopupBounds bounds, int padding)
        {
            pView = new PView()
            {
                Content = view,
                Border  = new PancakeView.Border()
                {
                    Color = view.BorderColor
                },
                CornerRadius      = view.CornerRadius,
                IsClippedToBounds = view.IsClippedToBounds,
                BackgroundColor   = Color.White,
                Padding           = padding,
                Shadow            = new PancakeView.DropShadow()
                {
                    Color      = Color.White,
                    Offset     = new Point(1, 1),
                    BlurRadius = 1,
                    Opacity    = 0.7f
                }
            };
            backDrop = new StackLayout()
            {
                BackgroundColor = Color.Black,
                Opacity         = 0.5
            };


            AbsoluteLayout.SetLayoutBounds(backDrop, new Rectangle(1, 1, 1, 1));
            AbsoluteLayout.SetLayoutFlags(backDrop, AbsoluteLayoutFlags.All);
            this.layout.Children.Add(backDrop);

            AbsoluteLayout.SetLayoutBounds(pView, bounds.ToRectangle());
            AbsoluteLayout.SetLayoutFlags(pView, AbsoluteLayoutFlags.All);
            this.layout.Children.Add(pView);

            view.BindingContext = this.BindingContext;
            if (view.AnimateOpen)
            {
                pView.ScaleTo(0.99, 200).ContinueWith(async(t) =>
                {
                    await pView.ScaleTo(1, 200);
                });
            }
        }