Пример #1
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            var bounds = AdjustForSafeArea(Bounds).ToRectangle();

            CrossPlatformMeasure?.Invoke(bounds.Width, bounds.Height);
            CrossPlatformArrange?.Invoke(bounds);
        }
Пример #2
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            var width  = Frame.Width;
            var height = Frame.Height;

            CrossPlatformArrange?.Invoke(Frame.ToRectangle());
        }
Пример #3
0
        protected override Windows.Foundation.Size ArrangeOverride(Windows.Foundation.Size finalSize)
        {
            if (CrossPlatformMeasure == null)
            {
                return(base.ArrangeOverride(finalSize));
            }

            var width  = finalSize.Width;
            var height = finalSize.Height;

            var size = CrossPlatformMeasure.Invoke(width, height);

            CrossPlatformArrange?.Invoke(new Rectangle(0, 0, width, height));
            CrossPlatformArrangeChildren?.Invoke();

            return(new Windows.Foundation.Size(size.Width, size.Height));
        }
Пример #4
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            var bounds = AdjustForSafeArea(Bounds).ToRectangle();

            CrossPlatformMeasure?.Invoke(bounds.Width, bounds.Height);
            CrossPlatformArrange?.Invoke(bounds);

            if (ChildMaskLayer != null)
            {
                ChildMaskLayer.Frame = bounds;
            }

            SetClip();

            LayoutSubviewsChanged?.Invoke(this, EventArgs.Empty);
        }
Пример #5
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

            var bounds = Frame.ToRectangle();

            if (View is ISafeAreaView sav && !sav.IgnoreSafeArea && RespondsToSafeArea())
            {
                var safe = SafeAreaInsets;
                bounds.X      += safe.Left;
                bounds.Y      += safe.Top;
                bounds.Height -= safe.Top + safe.Bottom;
                bounds.Width  -= safe.Left + safe.Right;
            }

            CrossPlatformMeasure?.Invoke(bounds.Width, bounds.Height);
            CrossPlatformArrange?.Invoke(bounds);
        }
Пример #6
0
        protected override Windows.Foundation.Size ArrangeOverride(Windows.Foundation.Size finalSize)
        {
            if (CrossPlatformMeasure == null)
            {
                return(base.ArrangeOverride(finalSize));
            }

            var width  = finalSize.Width;
            var height = finalSize.Height;

            var size = CrossPlatformMeasure.Invoke(width, height);

            CrossPlatformArrange?.Invoke(new Rectangle(0, 0, width, height));


            // AFAICT you have to call arrange on every child every single time
            // WinUI calls ArrangeOverride
            CrossPlatformArrangeChildren?.Invoke();

            return(new Windows.Foundation.Size(size.Width, size.Height));
        }