Пример #1
0
        /// <summary>
        /// Positions an object inside the current element and determines a size for a UIElement. Parent objects that implement custom layout
        /// for their child elements should call this method from their layout override implementations to form a recursive layout update.
        /// </summary>
        /// <param name="finalRect">The final size that the parent computes for the child in layout, provided as a <see cref="Windows.Foundation.Rect"/> value.</param>
        protected void ArrangeElement(View view, Rect finalRect)
        {
#if __WASM__
            view.Arrange(finalRect);
#else
            _layouter.ArrangeElement(view, finalRect);
#endif
        }
Пример #2
0
        /// <summary>
        /// Positions an object inside the current element and determines a size for a UIElement. Parent objects that implement custom layout
        /// for their child elements should call this method from their layout override implementations to form a recursive layout update.
        /// </summary>
        /// <param name="finalRect">The final size that the parent computes for the child in layout, provided as a <see cref="Windows.Foundation.Rect"/> value.</param>
        protected void ArrangeElement(View view, Rect finalRect)
        {
#if __WASM__
            var adjust = GetThicknessAdjust();

            // HTML moves the origin along with the border thickness.
            // Adjust the child based on this element's border thickness.
            var rect = new Rect(finalRect.X - adjust.Left, finalRect.Y - adjust.Top, finalRect.Width, finalRect.Height);

            view.Arrange(rect);
#else
            _layouter.ArrangeElement(view, finalRect);
#endif
        }