Exemplo n.º 1
0
        // Token: 0x0600569A RID: 22170 RVA: 0x0017F4C0 File Offset: 0x0017D6C0
        internal static Size StackArrangeHelper(IStackMeasure arrangeElement, IStackMeasureScrollData scrollData, Size arrangeSize)
        {
            UIElementCollection internalChildren = arrangeElement.InternalChildren;
            bool   flag      = arrangeElement.Orientation == Orientation.Horizontal;
            Rect   finalRect = new Rect(arrangeSize);
            double num       = 0.0;

            if (arrangeElement.IsScrolling)
            {
                if (flag)
                {
                    finalRect.X = StackPanel.ComputePhysicalFromLogicalOffset(arrangeElement, scrollData.ComputedOffset.X, true);
                    finalRect.Y = -1.0 * scrollData.ComputedOffset.Y;
                }
                else
                {
                    finalRect.X = -1.0 * scrollData.ComputedOffset.X;
                    finalRect.Y = StackPanel.ComputePhysicalFromLogicalOffset(arrangeElement, scrollData.ComputedOffset.Y, false);
                }
            }
            int i     = 0;
            int count = internalChildren.Count;

            while (i < count)
            {
                UIElement uielement = internalChildren[i];
                if (uielement != null)
                {
                    if (flag)
                    {
                        finalRect.X     += num;
                        num              = uielement.DesiredSize.Width;
                        finalRect.Width  = num;
                        finalRect.Height = Math.Max(arrangeSize.Height, uielement.DesiredSize.Height);
                    }
                    else
                    {
                        finalRect.Y     += num;
                        num              = uielement.DesiredSize.Height;
                        finalRect.Height = num;
                        finalRect.Width  = Math.Max(arrangeSize.Width, uielement.DesiredSize.Width);
                    }
                    uielement.Arrange(finalRect);
                }
                i++;
            }
            return(arrangeSize);
        }