コード例 #1
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);
        }
コード例 #2
0
        public void AddItemToCurrentRow(LayoutNode itemToAdd)
        {
            if (StopAddingNewItems)
            {
                return;
            }

            CurrentRow.AddItem(itemToAdd);

            var overflowedAlong         = CurrentRow.UsedAlongSize > AvailableAlongSize;
            var overflowedPerpendicular = UsedSize.OppositeAxisValue(Orientation.ToAxis()) > AvailablePerpendicularSize;
            var failed = overflowedPerpendicular || overflowedAlong;

            if (failed)
            {
            }
        }