title: TabControl Border is not hidden when adding the new button(add button) in tabpanel in wpf
body: <p>In tab control i have to add + button to tab item like in screenshot. I added the plus button to tab panel, when i run the program and selecting the tab item the tab control border is not hidden like normal tab control. please check the attached screenshot for clarity of my question. </p>
  
  <pre><code>&lt;Setter Property="Template"&gt;
                  &lt;Setter.Value&gt;
                      &lt;ControlTemplate TargetType="{x:Type TabControl}"&gt;
                          &lt;Grid
                              x:Name="templateRoot"
                              ClipToBounds="true"
                              KeyboardNavigation.TabNavigation="Local"
                              SnapsToDevicePixels="true"&gt;
                              &lt;Grid.ColumnDefinitions&gt;
                                  &lt;ColumnDefinition x:Name="ColumnDefinition0" /&gt;
                                  &lt;ColumnDefinition x:Name="ColumnDefinition1" Width="0" /&gt;
                              &lt;/Grid.ColumnDefinitions&gt;
                              &lt;Grid.RowDefinitions&gt;
                                  &lt;RowDefinition x:Name="RowDefinition0" Height="Auto" /&gt;
                                  &lt;RowDefinition x:Name="RowDefinition1" Height="*" /&gt;
                              &lt;/Grid.RowDefinitions&gt;
                              &lt;StackPanel
                                  x:Name="headerPanel"
                                  Grid.Row="0"
                                  Grid.Column="0"
                                  Orientation="Horizontal"&gt;
                                  &lt;TabPanel
                                      x:Name="_HeaderPanel"
                                      Panel.ZIndex="1"
                                      IsItemsHost="true"
                                      KeyboardNavigation.TabIndex="1" /&gt;
                                  &lt;Button
                                      x:Name="addButton"
                                      Width="50"
                                      Height="30"
                                      Background="LightGray"
                                      BorderBrush="LightGray"
                                      BorderThickness="1,0,0,0"
                                      Command="{Binding ChartAddButton_Click}"
                                      Content="+" /&gt;
                              &lt;/StackPanel&gt;
                              &lt;Border
                                  x:Name="contentPanel"
                                  Grid.Row="1"
                                  Grid.Column="0"
                                  Background="{TemplateBinding Background}"
                                  BorderBrush="{TemplateBinding BorderBrush}"
                                  BorderThickness="{TemplateBinding BorderThickness}"
                                  KeyboardNavigation.DirectionalNavigation="Contained"
                                  KeyboardNavigation.TabIndex="2"
                                  KeyboardNavigation.TabNavigation="Local"&gt;
                                  &lt;ContentPresenter
                                      x:Name="PART_SelectedContentHost"
                                      Margin="{TemplateBinding Padding}"
                                      ContentSource="SelectedContent"
                                      SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" /&gt;
                              &lt;/Border&gt;
                          &lt;/Grid&gt;
  </code></pre>
  
  <p>By adding the plus button to tab panel this will occurs. How to fix this. Please give your suggestion.</p>
  
  <p><a href="https://i.stack.imgur.com/FoiUp.png" rel="nofollow noreferrer">Please refer the updated screenshot</a></p>