示例#1
0
        public FlowLayoutRows(Point availableSize, FlowLayoutStyle flowLayoutStyle, Orientation orientation)
        {
            Orientation                = orientation;
            AvailableAlongSize         = availableSize.AxisValue(orientation.ToAxis());
            AvailablePerpendicularSize = availableSize.OppositeAxisValue(orientation.ToAxis());
            Style = flowLayoutStyle;

            CurrentRow = new FlowLayoutRow(AvailableAlongSize, Style, Orientation);
            Content.Add(CurrentRow);
        }
示例#2
0
        private bool HasRoomForAnotherRow(LayoutNode itemToAdd)
        {
            if (Style.OverflowRule.HasInfiniteRows)
            {
                return(true);
            }

            var possibleNewRow = new FlowLayoutRow(AvailableAlongSize, Style, Orientation);

            possibleNewRow.AddItem(itemToAdd);
            var totalSizeAfterAddingRow = UsedSize.OppositeAxisValue(Orientation.ToAxis()) + possibleNewRow.UsedPerpendicularSize;

            return(totalSizeAfterAddingRow <= AvailablePerpendicularSize);
        }
示例#3
0
 private void AddNewRow()
 {
     PerpendicularSizeOfAllRowsExceptCurrent += CurrentRow.UsedPerpendicularSize;
     CurrentRow = new FlowLayoutRow(AvailableAlongSize, Style, Orientation);
     Content.Add(CurrentRow);
 }