Пример #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 (GridLengthHelper.GetIsStar(sizeHint))
            {
                starTotal += sizeHint.Value;
            }
            else if (GridLengthHelper.GetIsAuto(sizeHint))
            {
                ComputeChildAutoSize(child, orientation, ref finalSize, ref totalLength, ref size);
            }
            else if (GridLengthHelper.GetIsAbsolute(sizeHint))
            {
                ComputeChildAbsoluteSize(orientation, ref finalSize, ref totalLength, ref sizeHint, ref size);
            }

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

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