static double ArrangeChild(IView child, int spacing, double x) { var destination = new Rectangle(x, 0, child.DesiredSize.Width, child.DesiredSize.Height); child.Arrange(destination); return(destination.Width + spacing); }
static double ArrangeChildFromLeftEdge(IView child, double height, double top, double x) { var destination = new Rect(x, top, child.DesiredSize.Width, height); child.Arrange(destination); return(destination.Width); }
static double ArrangeChildFromRightEdge(IView child, double height, double top, double x) { var width = child.DesiredSize.Width; var destination = new Rect(x - width, top, width, height); child.Arrange(destination); return(-destination.Width); }
protected void InitializeViewHandler(IView view, IViewHandler handler, IMauiContext mauiContext = null) { handler.SetMauiContext(mauiContext ?? MauiContext); handler.SetVirtualView(view); view.Handler = handler; view.Arrange(new Rectangle(0, 0, view.Width, view.Height)); handler.NativeArrange(view.Frame); }
internal static void LayoutToSize(this IView view, double width, double height) { var platformFrame = new CGRect(0, 0, width, height); if (view.Handler is IPlatformViewHandler viewHandler && viewHandler.PlatformView != null) { viewHandler.PlatformView.Frame = platformFrame; } view.Arrange(platformFrame.ToRectangle()); }
internal static Size LayoutToMeasuredSize(this IView view, double width, double height) { var size = view.Measure(width, height); var platformFrame = new CGRect(0, 0, size.Width, size.Height); if (view.Handler is IPlatformViewHandler viewHandler && viewHandler.PlatformView != null) { viewHandler.PlatformView.Frame = platformFrame; } view.Arrange(platformFrame.ToRectangle()); return(size); }
protected THandler CreateHandler <THandler>(IView view) where THandler : IViewHandler { var handler = Activator.CreateInstance <THandler>(); handler.SetMauiContext(MauiContext); handler.SetVirtualView(view); view.Handler = handler; view.Arrange(new Rectangle(0, 0, view.Width, view.Height)); handler.NativeArrange(view.Frame); return(handler); }
protected THandler CreateHandler <THandler>(IView view) where THandler : IViewHandler { var handler = Activator.CreateInstance <THandler>(); handler.SetMauiContext(MauiContext); handler.SetVirtualView(view); view.Handler = handler; var size = view.Measure(double.PositiveInfinity, double.PositiveInfinity); view.Arrange(new Rect(0, 0, size.Width, size.Height)); handler.PlatformArrange(view.Frame); return(handler); }