public override void LayoutSubviews() { base.LayoutSubviews(); var bounds = AdjustForSafeArea(Bounds).ToRectangle(); CrossPlatformMeasure?.Invoke(bounds.Width, bounds.Height); CrossPlatformArrange?.Invoke(bounds); }
public override void LayoutSubviews() { base.LayoutSubviews(); var width = Frame.Width; var height = Frame.Height; CrossPlatformArrange?.Invoke(Frame.ToRectangle()); }
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)); }
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); }
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); }
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)); }