How to change background color of TabItems on mouse over?

<TabControl >
            <TabControl.ItemContainerStyle>
                <Style TargetType="TabItem" BasedOn="{StaticResource {x:Type TabItem}}">
                    <Setter Property="HeaderTemplate">
                        <Setter.Value>
                            <DataTemplate>
                                <StackPanel Orientation="Horizontal" Margin="5" >
                                    <StackPanel.Style>
                                        <Style TargetType="StackPanel">
                                            <Setter Property="Background" Value="Red"/>
                                            <Style.Triggers>
                                                <Trigger Property="IsMouseOver" Value="true">
                                                    <Setter Property="Background" Value="Green"/>
                                                </Trigger>
                                            </Style.Triggers>
                                        </Style>
                                    </StackPanel.Style>
                                    <TextBlock Text="{Binding}"/>
                                 
                                </StackPanel>
                            </DataTemplate>
                        </Setter.Value>
                    </Setter>
                </Style>
            </TabControl.ItemContainerStyle>
        </TabControl>

Comments