Example #1
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

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

            CrossPlatformMeasure?.Invoke(bounds.Width, bounds.Height);
            CrossPlatformArrange?.Invoke(bounds);
        }
Example #2
0
        public override void LayoutSubviews()
        {
            base.LayoutSubviews();

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

            CrossPlatformMeasure?.Invoke(width, height);
            CrossPlatformArrange?.Invoke(Frame.ToRectangle());
        }
Example #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));
        }
Example #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);
        }
Example #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);
        }
Example #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));
        }
Example #7
0
 public TSize Measure(double availableWidth, double availableHeight)
 {
     return(CrossPlatformMeasure?.Invoke(availableWidth.ToScaledDP(), availableHeight.ToScaledDP()).ToPixel() ?? new TSize(0, 0));
 }