private int GetChildColumnSpan(BindableObject child, GridWidth gridWidth) { var large = ResponsiveGrid.GetLarge(child); var medium = ResponsiveGrid.GetMedium(child); var small = ResponsiveGrid.GetSmall(child); var extraSmall = ResponsiveGrid.GetExtraSmall(child); switch (gridWidth) { case GridWidth.ExtraSmall: return(extraSmall ?? small ?? medium ?? large ?? 1); case GridWidth.Small: return(small ?? extraSmall ?? medium ?? large ?? 1); case GridWidth.Medium: return(medium ?? small ?? extraSmall ?? large ?? 1); case GridWidth.Large: return(large ?? medium ?? small ?? extraSmall ?? 1); default: return(1); } }
private IReadOnlyList <int> GetAvailableResponsiveRows() { var rows = new List <int>(); foreach (var child in this.AssociatedObject.Children) { var reponsiveRow = ResponsiveGrid.GetRow(child); if (rows.All(r => r != reponsiveRow)) { rows.Add(reponsiveRow); } } return(rows.OrderBy(r => r).ToList()); }
private IReadOnlyList <BindableObject> GetChildrenByRow(int row) { var items = new List <BindableObject>(); foreach (var child in this.AssociatedObject.Children) { var reponsiveRow = ResponsiveGrid.GetRow(child); if (reponsiveRow == row) { items.Add(child); } } return(items); }