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); }
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); }
private void AddNewRow() { PerpendicularSizeOfAllRowsExceptCurrent += CurrentRow.UsedPerpendicularSize; CurrentRow = new FlowLayoutRow(AvailableAlongSize, Style, Orientation); Content.Add(CurrentRow); }