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

TabControl cannot switch TabItem #13

Open
montex12 opened this issue May 28, 2023 · 1 comment
Open

TabControl cannot switch TabItem #13

montex12 opened this issue May 28, 2023 · 1 comment

Comments

@montex12
Copy link

Hello
I am trying to use the experimental TabControl but seems I cannot switch page by using a button as header.

        <labs:TabItem Header="Page 1">
            This is Page 1
        </labs:TabItem>
        <labs:TabItem Header="Page 2">
            This is Page 2
        </labs:TabItem>

        <labs:TabItem>
            <labs:TabItem.Header>
                <Button>Button Page 3</Button>
            </labs:TabItem.Header>
            <labs:TabItem.Content>
                <TextBlock>Page 3</TextBlock>
            </labs:TabItem.Content>
        </labs:TabItem>

        <labs:TabItem>
            <labs:TabItem.Header>
                <Button>Button Page 4</Button>
            </labs:TabItem.Header>
            <labs:TabItem.Content>
                <TextBlock>Page 4</TextBlock>
            </labs:TabItem.Content>
        </labs:TabItem>

I can navigate to Page 1 and Page 2 but not Page 3 and Page 4 when I click on the button.

Is there a way to use buttons as headers?

@emmauss
Copy link
Collaborator

emmauss commented May 28, 2023

Button captures the pointer events and prevents parent controls from handling them. It's recommended not to use interactive controls as header.

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