private void ChangeBreakpointType(int windowWith) { if (windowWith < currentBreakpointType.Width) { if (currentBreakpointType != BreakpointType.Sm) { currentBreakpointType = BreakpointType.FromValue(currentBreakpointType.Value - 1); } ChangeBreakpointType(windowWith); } if (windowWith > currentBreakpointType.Width) { if (currentBreakpointType != BreakpointType.Xxl) { if (windowWith > BreakpointType.FromValue(currentBreakpointType.Value + 1).Width) { currentBreakpointType = BreakpointType.Xxl; ChangeBreakpointType(windowWith); } } } }
private List <List <DescriptionsItem> > GetRows(List <DescriptionsItem> children, BreakpointType breakpoint) { List <List <DescriptionsItem> > rows = new List <List <DescriptionsItem> >(); List <DescriptionsItem> tmpRow = new List <DescriptionsItem>(); int rowRestColumn = Column.GetCurrentCulloms(breakpoint); foreach (DescriptionsItem item in children) { int mergedSpan = item.Span; // Additional handle last one if (item.Index == children.Count - 1) { item.AdjustSpanRestOfRow(rowRestColumn); tmpRow.Add(item); rows.Add(tmpRow); return(rows); } if (mergedSpan < rowRestColumn) { rowRestColumn -= mergedSpan; tmpRow.Add(item); } else { if (mergedSpan > rowRestColumn) { item.AdjustSpanRestOfRow(rowRestColumn); } tmpRow.Add(item); rows.Add(tmpRow); rowRestColumn = Column.GetCurrentCulloms(breakpoint); tmpRow = new List <DescriptionsItem>(); } } return(rows); }