Example #1
0
        private Record ComputeChildSize(UIElement child, Orientation orientation, ref Size finalSize, ref double totalLength, ref double starTotal)
        {
            var sizeHint = GetChildSizeHint(child);
            var size     = new Size();

            if (GridLengthHelper2.GetIsStar(sizeHint))
            {
                starTotal += sizeHint.Value;
            }
            else if (GridLengthHelper2.GetIsAuto(sizeHint))
            {
                ComputeChildAutoSize(child, orientation, ref finalSize, ref totalLength, ref size);
            }
            else if (GridLengthHelper2.GetIsAbsolute(sizeHint))
            {
                ComputeChildAbsoluteSize(orientation, ref finalSize, ref totalLength, ref sizeHint, ref size);
            }

            return(new Record
            {
                Child = child,
                Size = size,
                SizeHint = sizeHint,
            });
        }
Example #2
0
        private void MeasureChild(UIElement child, Size availableSize, Orientation orientation, ref Size totalSize, ref double starTotal)
        {
            var sizeHint = GetChildSizeHint(child);

            if (GridLengthHelper2.GetIsStar(sizeHint))
            {
                starTotal += sizeHint.Value;
            }
            else if (GridLengthHelper2.GetIsAuto(sizeHint))
            {
                MesureChildAuto(child, orientation, availableSize, ref totalSize);
            }
            else if (GridLengthHelper2.GetIsAbsolute(sizeHint))
            {
                MesureChildAbsolute(child, orientation, availableSize, sizeHint, ref totalSize);
            }
        }