Esempio n. 1
0
        private void MainAdd(View view, double i)
        {
            var bounds = new ViewBounds
            {
                X      = i,
                Y      = i,
                Width  = 50,
                Height = 50,
            };

            Main.Views.Add(view, bounds);

            Main.Children.Add(view,
                              Constraint.RelativeToParent((p) =>
            {
                return(bounds.X);
            }),
                              Constraint.RelativeToParent((p) =>
            {
                return(bounds.Y);
            }),
                              Constraint.RelativeToParent((p) =>
            {
                return(bounds.Width);
            }),
                              Constraint.RelativeToParent((p) =>
            {
                return(bounds.Height);
            })
                              );
        }
Esempio n. 2
0
        private void ChildrenAdd(View view, double x = 0, double y = 0, double widthh = 0, double height = 0)
        {
            var bounds = new ViewBounds
            {
                X      = x,
                Y      = y,
                Width  = 50,
                Height = 50,
            };

            Views.Add(view, bounds);

            this.Children.Add(view,
                              Constraint.RelativeToParent((p) =>
            {
                return(bounds.X);
            }),
                              Constraint.RelativeToParent((p) =>
            {
                return(bounds.Y);
            }),
                              Constraint.RelativeToParent((p) =>
            {
                return(bounds.Width);
            }),
                              Constraint.RelativeToParent((p) =>
            {
                return(bounds.Height);
            })
                              );
        }
Esempio n. 3
0
        protected override void OnSizeAllocated(double width, double height)
        {
            base.OnSizeAllocated(width, height);

            if (!First)
            {
                ShadowSize = new ViewBounds
                {
                    Width  = width / 2 - 50,
                    Height = height / 2 - 50
                };

                ShadowPosition = new ViewBounds
                {
                    X = 0,
                    Y = height
                };

                // DialogShadow.BindingContext = ShadowPosition;
                // ImitationDialog.BindingContext = ShadowSize;

                // DialogShadow.LayoutTo(new Rectangle(0, height, width, height), 0);

                Shadow.LayoutTo(new Rectangle(0, height, width, height));
                Shadow.Opacity = 0;

                ImitationDialog.LayoutTo(new Rectangle(width / 2 - 50, height, 100, 100));
                ImitationDialog.Opacity = 0;

                System.Diagnostics.Debug.WriteLine("deg : " + height + ", ");

                var rc = CustomDialog.Bounds;
                rc.X = -1000;
                CustomDialog.LayoutTo(rc, 0);

                Dialog = new ImitationDialog
                {
                    Shadow = Shadow,
                    Dialog = CustomDialog,
                };

                Opacity = 1;
            }
        }