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 TabItem Header Height #3150

Closed
AlMcLeanYF opened this issue Mar 28, 2023 · 2 comments
Closed

TabControl TabItem Header Height #3150

AlMcLeanYF opened this issue Mar 28, 2023 · 2 comments
Labels
enhancement evaluation required Items is pending review or evaluation by the team

Comments

@AlMcLeanYF
Copy link

Hi

I am looking for a bit of help if possible, please.

I have put together the following markup:

<TabItem.Header>
      <StackPanel Orientation="Horizontal">
          <Label Content="Results Blocks"/>
          <Button
              Style="{StaticResource MaterialDesignFloatingActionButton}"
              Command="{Binding AddNewResultsBlockCommand}"
              ToolTip="Add"
              >
              <materialDesign:PackIcon
                  Kind="Plus"
                  Height="{StaticResource IconSize}"
                  Width="{StaticResource IconSize}" />
          </Button>
      </StackPanel>
  </TabItem.Header>

This inserts a button in my tab header, which is great. Unfortunately I cannot suss out how to increase the height of the tab header to prevent the button from being cut off. Could anyone please advise?

This is what the rendered control currently looks like:

image

Cheers

Al

@AlMcLeanYF AlMcLeanYF added enhancement evaluation required Items is pending review or evaluation by the team labels Mar 28, 2023
@nicolaihenriksen
Copy link
Contributor

@AlMcLeanYF have you tried setting the Height property directly on the TabItem? I can see that it defaults to 48px in the template, and then some default padding as well.

@nicolaihenriksen
Copy link
Contributor

@AlMcLeanYF I just verified that you can indeed just override the Height directly on the TabItem. Another approach would be to override it using a style override instead. In any case, this is not an issue, so I will close it.

image

<TabControl Width="300">
  <TabItem Header="TAB 1">
    <TextBlock Margin="8" Text="Default Tab 1" />
  </TabItem>
  <TabItem Height="80">
    <TabItem.Header>
      <StackPanel Orientation="Horizontal">
        <Label Content="Results Blocks" />
        <Button Style="{StaticResource MaterialDesignFloatingActionButton}" ToolTip="Add">
          <materialDesign:PackIcon Kind="Plus" Height="30" Width="30" />
        </Button>
      </StackPanel>
    </TabItem.Header>
    <TextBlock Margin="8" Text="Default Tab 2" />
  </TabItem>
</TabControl>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement evaluation required Items is pending review or evaluation by the team
Projects
None yet
Development

No branches or pull requests

2 participants