Skip to content

How to place 30 items each page (arrange in 2 columns) ? #21

Answered by MarcinZiabek
EZSWTool01 asked this question in Q&A
Discussion options

You must be logged in to vote

This code is far from being perfect but it is shows how described layout can be accomplished:

var elements = Enumerable
    .Range(1, 100)
    .Select(x => $"Item {x}")
    .ToList();

container
    .Background(Colors.White)
    .Padding(25)
    .Stack(pageStack =>
    {
        while (elements.Any())
        {
            var pageElements = elements.Take(30).ToList();
            elements = elements.Skip(30).ToList();
            
            pageStack.Item().Row(row =>
            {
                row.RelativeColumn().Stack(stack =>
                {
                    pageElements
                        .Take(15)
                        .ToList()
                        .ForEach(x =>

Replies: 4 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by MarcinZiabek
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants