Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to keep items "together" and not break them appart? #108

Closed
Oaktribe opened this issue Jan 25, 2022 · 2 comments
Closed

How to keep items "together" and not break them appart? #108

Oaktribe opened this issue Jan 25, 2022 · 2 comments

Comments

@Oaktribe
Copy link

Currently I have something like this which I append as the last content

private void ComposeSupport(IContainer container)
{
    container.PaddingTop(PADDING_TOP).Stack(stack =>
    {
        stack.Item().Text("Support Headline", _headerStyle);
        stack.Item().Text("Support text and other info");
    });
}

Which works fine, however, sometimes the content before is large enough to put the support headline on page 1 and the support text on page two.

Is there a way keep the container in the same page? Example, if everything won't fit on page 1, it will then instead be on page 2.

@MarcinZiabek
Copy link
Member

Yes, it is possible by using the ShowEntire element, take a look here.

Naming stuff is difficult - if you have a better idea of how to name this element, please share! 😄

@Oaktribe
Copy link
Author

That worked! Thank you!

Yeah, naming stuff is hard 😅
When I first read documentation of that I thought it meant everything will be shown as a single page, I.e. no pagination at all.
(English is not my first language, so it could be I misunderstood it too)

I think a example would improve it. Maybe something like this?

container.ShowEntire().Stack(stack =>
{
    stack.Item().Text("Headline");
    stack.Item().Text("This text and headline will be kept on the same page.");
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants