title: How can I bind Wpf DataGridColumn to an object?
body: <p>I want to bind the columns of my WPF DataGrid to some objects in a Dictionary like this:</p>
  
  <p>Binding Path=Objects[i] </p>
  
  <p>where Objects is my Dictionary of objects, so that each cell will represent an Object element. How can I do that?</p>
  
  <p>I suppose that I need to create a template for my cell, which I did, but how to get the result of column binding in my template? I know that by default the content of a DataGridCell is a TextBlock and it's Text property is set through column binding result, but if that result is an object I guess that I have to create a ContentTemplate. How do I do that, as the stuff I tried is not displaying anything.</p>
  
  <p>Here it is what I tried:</p>
  
  <pre><code>&lt;Style x:Key="CellStyle" TargetType="{x:Type dg:DataGridCell}"&gt;
      &lt;Setter Property="Template"&gt; ---it should realy be ContentTemplate?
        &lt;Setter.Value&gt;
          &lt;ControlTemplate&gt;
            &lt;controls:DataGridCellControl CurrentObject="{Binding }"/&gt; -- I would expect to get the object like this for this column path : Path=Objects[i] but is not working
          &lt;/ControlTemplate&gt;
        &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
    &lt;/Style&gt;
  </code></pre>
  
  <p>So, to make myself completly clear, i want to get in CurrentObject property of my DataGridCellControl the current object that should result if I set the column binding in my data grid like this Path=Objects[i].</p>
  
  <p>Thank you for any suggestion,</p>
  
  <p>John.</p>