title: Inheriting WPF DataGrid styles in a custom CellTemplate
body: <p>I wish to have a custom column type in a WPF datagrid, part of which will be a textbox for user input. Unfortunately, it does not appear to inherit the look and feel of the datagrid itself- it doesn't show the alternating colour, when a row is selected or edited the cell in question doesn't highlight in the same way, and so on.</p>
  
  <pre><code>           &lt;DataGridTemplateColumn Header="Name" &gt;
                  &lt;DataGridTemplateColumn.CellTemplate&gt;
                      &lt;DataTemplate &gt;
                          &lt;TextBox Text="{Binding DisplayName,Mode=TwoWay,UpdateSourceTrigger=PropertyChanged}" IsReadOnly="False" BorderThickness="0" /&gt;                          
                      &lt;/DataTemplate&gt;
                  &lt;/DataGridTemplateColumn.CellTemplate&gt;
              &lt;/DataGridTemplateColumn&gt;
  </code></pre>
  
  <p>It looks like the style of a default textbox overrides that of the datagrid; is there a way just to use the datagrids style? I could of course style the textbox to mimic the datagrid, but if I wish to add other controls I'd have to do that for each one as well. If I do go down that route, how would I change the style based on properties of the datagridrow from within the celltemplate?- for example IsSelected.</p>