Change background color in a TabControl inpedendizandolo Header

0

I try to change the background color in TabControl but I do not want to change the color of the tab;

I use the following resource;

 <Style TargetType="TabItem">
           <Setter Property="Template">
               <Setter.Value>
                   <ControlTemplate TargetType="TabItem">
                       <Border Name="Border" BorderThickness="1,1,1,0" BorderBrush="Gainsboro" CornerRadius="4,4,0,0" Margin="2,0" Background="#FF494F76" Opacity="0.6" TextElement.Foreground="white">
                           <ContentPresenter x:Name="ContentSite"
                                    VerticalAlignment="Center"
                                    HorizontalAlignment="Center"
                                    ContentSource="Header"
                                    Margin="10,2"/>
                       </Border>

                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="Border" Property="Opacity" Value="1"/>
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>

Is it possible in any way, without adding a Grid , Border , Stackpanel etc ... to change the color only of the content of TabItem Without touching the color of the own tab?

Thanks

    
asked by Edulon 05.12.2018 в 21:16
source

0 answers