title: Custom DataGrid column with a CellTemplate and binding
body: <p>I need to create a reusable DataGrid column with a custom CellTemplate. This CellTemplate should, among other things, contain a TextBlock control to which I need to bind values to display in the DataGrid. All examples I've seen so far specified the CellTemplate for a column directly when using it in a DataGrid's Columns property and also specified a Binding directly to the TextBlock, e.g.:</p>
  
  <pre><code>&lt;data:DataGrid&gt;
      &lt;data:DataGrid.Columns&gt;
          &lt;data:DataGridTemplateColumn Header="Name"&gt;
              &lt;data:DataGridTemplateColumn.CellTemplate&gt;
                  &lt;DataTemplate&gt;
                      &lt;TextBlock Text="{Binding Name}"/&gt;
                  &lt;/DataTemplate&gt;
              &lt;/data:DataGridTemplateColumn.CellTemplate&gt;
          &lt;/data:DataGridTemplateColumn&gt;
      &lt;/data:DataGrid.Columns&gt;
  &lt;/data:DataGrid&gt;
  </code></pre>
  
  <p>I need to encapsulate this column into a single, reusable control and I want to specify a Binding for it just like for an ordinary DataGridTextColumn. In other words, when using this custom column, I just want to write something like this:</p>
  
  <pre><code>&lt;data:DataGrid&gt;
      &lt;data:DataGrid.Columns&gt;
          &lt;controls:CustomColumn Header="Name" Binding="{Binding Name}" /&gt;
      &lt;/data:DataGrid.Columns&gt;
  &lt;/data:DataGrid&gt;
  </code></pre>
  
  <p>Problem is that the DataGridTemplateColumn my custom column is inheriting from does not have the Binding property. I thought that I will be able to use DataGridBoundColumn, but it's not possible to specify a CellTemplate for it.</p>
  
  <p>How to achieve a desired behavior? Thank you!</p>