title: How to prevent double thickness borders at overlap?
body: <p>If you have:</p>
  
  <pre><code>&lt;Grid &gt;
    &lt;Grid.RowDefinitions&gt;
      &lt;RowDefinition Height="*"/&gt;
      &lt;RowDefinition Height="2*"/&gt;
      &lt;RowDefinition Height="*"/&gt;
    &lt;/Grid.RowDefinitions&gt;
  &lt;/Grid&gt;
  </code></pre>
  
  <p>and put a border of thickness 1 into each grid, you will get double thickness on the border between the grid rows. Is the only way to deal with this to specify the thickness on each edge of the border or is there some control that will create borders around the grid for each column without having double thickness?</p>
  
  <p>Currently attempting it with this:</p>
  
  <pre><code>                    &lt;Border  
                        BorderBrush="Black"
                        BorderThickness="1"
                        Margin="19,0,0,0"  
                        Background="LightGray"
                        &gt;
                        &lt;Viewbox VerticalAlignment="Stretch" HorizontalAlignment="Stretch"&gt;
                          &lt;Grid&gt;
                            &lt;Grid.RowDefinitions&gt;
                              &lt;RowDefinition Height="*"/&gt;
                              &lt;RowDefinition Height="2*"/&gt;
                              &lt;RowDefinition Height="*"/&gt;
                            &lt;/Grid.RowDefinitions&gt;
                            &lt;Grid.ColumnDefinitions&gt;
                          &lt;ColumnDefinition Width="*"/&gt;
                          &lt;ColumnDefinition Width="Auto"/&gt;
                          &lt;ColumnDefinition Width="Auto"/&gt;
                        &lt;/Grid.ColumnDefinitions&gt;
  
                        &lt;TextBlock
                          Grid.Row="1"
                          Grid.Column="0"
                          x:Name="TreeViewHeaderTextBox" 
                          VerticalAlignment="Center"
                          HorizontalAlignment="Center" 
                          Text="Time"
                          Foreground="Black"
                          /&gt;
  
  
                        &lt;TextBlock
                          Grid.Row="1"
                          Grid.Column="1"
                          Text="X"
                          TextAlignment="Center"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Center"
                          /&gt;
  
                        &lt;TextBlock 
                          Grid.Row="1"
                          Grid.Column="2"
                          Text="O"
                          TextAlignment="Center"
                          HorizontalAlignment="Stretch"
                          VerticalAlignment="Center"
                          /&gt;
  
                      &lt;/Grid&gt;
                    &lt;/Viewbox&gt;
                  &lt;/Border&gt;
  </code></pre>
  
  <p>However, I started making changes to the old code so this isn'ta  really good example of the double borders. However, I am also getting double borders from this template.</p>
  
  <pre><code>              &lt;Border Name="Bd"
                        Grid.Column="1"
                        Background="{TemplateBinding Background}"
                        BorderBrush="{TemplateBinding BorderBrush}"
                        BorderThickness="{TemplateBinding BorderThickness}"
                        Padding="{TemplateBinding Padding}"
                        SnapsToDevicePixels="true"&gt;
                  &lt;ContentPresenter x:Name="PART_Header"
                                    ContentSource="Header"
                                    HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
                                    SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/&gt;
                &lt;/Border&gt;
  </code></pre>
  
  <p>as each item ends up with a double thickness border where it touches the next item.</p>
  
  <p>edit 2: After reading the comments I realized I probably should not have a border defined on the datatemplate for the control and instead just set the border through the control and change the template on the controltemplate. May be getting double borders from that.</p>