title: Centering a checkbox in a GridViewColumn?
body: <p>I'm currently struggling on getting my <code>CheckBox</code>es to properly center within my <code>GridViewColumn</code>s.</p>
  
  <p>I've defined a <code>Style</code> for my <code>CheckBox</code>es like so:</p>
  
  <pre><code>&lt;Style TargetType="{x:Type CheckBox}" x:Key="DataGridCheckBox"&gt;
      &lt;Setter Property="HorizontalAlignment" Value="Center" /&gt;
      &lt;Setter Property="HorizontalContentAlignment" Value="Center" /&gt;
      &lt;Setter Property="IsEnabled" Value="False" /&gt;
      &lt;Setter Property="Margin" Value="4" /&gt;
      &lt;Setter Property="VerticalAlignment" Value="Center" /&gt;
      &lt;Setter Property="VerticalContentAlignment" Value="Center" /&gt;
      &lt;Setter Property="Width" Value="{Binding RelativeSource={RelativeSource FindAncestor,AncestorType={x:Type GridViewColumn}},Path=ActualWidth}" /&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>And my <code>CheckBox</code>es are added into the <code>GridViewColumn</code> using a <code>DataTemplate</code> like this:</p>
  
  <pre><code>&lt;GridViewColumn Header="Comment"&gt;
      &lt;GridViewColumn.CellTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;CheckBox Style="{StaticResource DataGridCheckBox}" IsChecked="{Binding PropertyItem.Comment, Converter={StaticResource booleanConverter}, ConverterParameter='string'}"/&gt;
          &lt;/DataTemplate&gt;
      &lt;/GridViewColumn.CellTemplate&gt;
  &lt;/GridViewColumn&gt;
  </code></pre>
  
  <p>But the problem I have is that the <code>CheckBox</code>es remain left-aligned (even when resizing the column).</p>
  
  <p>Any ideas?</p>
  
  <p>Thanks in advance,<br />
  Sonny</p>
  
  <p><strong>EDIT:</strong>  I've been messing around with a <code>CheckBox</code>in a blank window and I think the problem may be related to the <code>CheckBox</code>control.  If I make a very wide <code>CheckBox</code>, I still can't seem to get the <code>CheckBox</code>portion of it to align within itself.  It always wants to go to the upper-left.  As per the name, the <code>ContentAlignment</code> properties only seem to align the content.</p>