示例#1
0
            private double GetSumOfWrappingLevelWidths(int wrappingLevels, double totalWidth)
            {
                double num = 0.0;
                int    perWrappingLevel = GreedyWrapPanel.CalculateCountPerWrappingLevel(this._childSizes.Count, wrappingLevels);
                int    start            = 0;

                while (start < this._childSizes.Count)
                {
                    num   += this.GetMaxWidthForWrappingLevel(start, perWrappingLevel);
                    start += perWrappingLevel;
                }
                return(num);
            }
示例#2
0
            private double CalculateHeight()
            {
                int    perWrappingLevel = GreedyWrapPanel.CalculateCountPerWrappingLevel(this._childSizes.Count, this._actualWrappingLevels);
                double num   = 0.0;
                int    start = 0;

                while (start < this._childSizes.Count)
                {
                    double forWrappingLevel = this.GetHeightForWrappingLevel(start, perWrappingLevel);
                    if (forWrappingLevel > num)
                    {
                        num = forWrappingLevel;
                    }
                    start += perWrappingLevel;
                }
                return(num);
            }
示例#3
0
        protected override Size ArrangeOverride(Size finalSize)
        {
            int totalCount = this.NonCollapsedChildren.Count <UIElement>();

            if (totalCount == 0)
            {
                return(finalSize);
            }
            GreedyWrapPanel.ChildArranger childArranger = new GreedyWrapPanel.ChildArranger(new AbstractPoint(Orientation.Vertical, this.Orientation, 0.0, 0.0), GreedyWrapPanel.CalculateCountPerWrappingLevel(totalCount, this.ActualWrappingLevels));
            foreach (UIElement nonCollapsedChild in this.NonCollapsedChildren)
            {
                AbstractSize  abstractSize        = this.ConvertToAbstractSize(nonCollapsedChild.DesiredSize);
                AbstractPoint positionOfNextChild = childArranger.GetPositionOfNextChild(abstractSize);
                nonCollapsedChild.Arrange(new Rect(positionOfNextChild.RealPoint, nonCollapsedChild.DesiredSize));
            }
            return(childArranger.TotalSize.RealSize);
        }