Make tab same color as the tab content in WPF

I am trying to make the selected tab to be same color as the tab content and the other tab to be gray out.

For example in the attached image, I would like to make 'First' tab blue as the content is blue too.

Does anyone what I need to do that.  Thanks
<Window x:Class="tbTest.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    Title="Window1" Height="300" Width="300">
    <Window.Resources>
        <Style TargetType="TabControl" x:Key="SelectedBackgroundStyle">
            <Setter Property="Background"
                    Value="{Binding SelectedItem.Background, RelativeSource={x:Static RelativeSource.Self}}">
            </Setter>
        </Style>
    </Window.Resources>
    <Grid>
        <TabControl x:Name="Tabs" Style="{StaticResource SelectedBackgroundStyle}" Margin="36,60,37,12">
            <TabItem Header="First" Background="Blue">
                <TextBlock Height="144" Width="257">Test</TextBlock>
            </TabItem>
            <TabItem Header="Second" Background="Green"/>
            <TabItem Header="Third"  Background="Orange"/>
        </TabControl>
    </Grid>
</Window>

Open in new window

tabs.JPG
xewooxAsked:
Who is Participating?
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.