TabControl | TabItem Icon + Header Text #3194
-
Beta Was this translation helpful? Give feedback.
Answered by
nicolaihenriksen
May 15, 2023
Replies: 1 comment
-
@ZeroByteZDev What you're trying to do here is to make the header consist of multiple controls. That is definitely possible, but you need to specify it in a different manner. In the example below I have taken your first <materialDesign:Card>
<TabControl HorizontalContentAlignment="Left" materialDesign:ColorZoneAssist.Mode="SecondaryMid" Style="{StaticResource MaterialDesignFilledTabControl}">
<TabItem>
<TabItem.Header>
<StackPanel Orientation="Horizontal">
<materialDesign:PackIcon Kind="Home" VerticalAlignment="Center" Height="20" Width="20" />
<TextBlock VerticalAlignment="Center" Margin="10,0,0,0">Home</TextBlock>
</StackPanel>
</TabItem.Header>
<TextBlock Margin="8" Text="Secondary filled example tab 1" />
</TabItem>
<TabItem Header="{materialDesign:PackIcon Controller, Size=20}">
<TextBlock Margin="8" Text="Secondary filled example tab 2" />
</TabItem>
<TabItem Header="{materialDesign:PackIcon Settings, Size=20}">
<TextBlock Margin="8" Text="Secondary filled example tab 2" />
</TabItem>
<TabItem Header="{materialDesign:PackIcon Account, Size=20}">
<TextBlock Margin="8" Text="Secondary filled example tab 2" />
</TabItem>
</TabControl>
</materialDesign:Card> |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
ZeroByteZDev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@ZeroByteZDev What you're trying to do here is to make the header consist of multiple controls. That is definitely possible, but you need to specify it in a different manner. In the example below I have taken your first
TabItem
and changed the look of theTabItem.Header
. Basically instead of "just" consisting of thePackIcon
, I now set it as aStackPanel
with both the icon and a text in it.