예제 #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;

            CrossPlatformMeasure?.Invoke(width, 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
파일: LayoutView.cs 프로젝트: jrockhub/maui
        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));
        }
예제 #7
0
 public TSize Measure(double availableWidth, double availableHeight)
 {
     return(CrossPlatformMeasure?.Invoke(availableWidth.ToScaledDP(), availableHeight.ToScaledDP()).ToPixel() ?? new TSize(0, 0));
 }