title: DataBinding inside a ContentTemplate inside a Style in Silverlight
body: <p>I'm defining the following style in XAML:</p>
  
  <pre><code> &lt;Style TargetType="telerik:RadDiagramShape" x:Key="styleShapeBase"&gt;
      &lt;Setter Property="Width" Value="120" /&gt;
      &lt;Setter Property="Height" Value="60" /&gt;
      &lt;Setter Property="IsResizingEnabled" Value="False" /&gt;
      &lt;Setter Property="ContentTemplate"&gt;
          &lt;Setter.Value&gt;
              &lt;DataTemplate&gt;
                  &lt;TextBlock x:Name="lblName" Text="{Binding Name}" /&gt;
              &lt;/DataTemplate&gt;
          &lt;/Setter.Value&gt;
       &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>Then in the code-behind I'm <strong>assigning the data context</strong>. I want to draw a shape with some text in it that comes from an object (if this end up working I'm going to put more info there). I'm doing it like this:</p>
  
  <pre><code>var shape = new RadDiagramShape();
  shape.Style = (Style)Resources["styleShapeBase"];
  shape.DataContext = item.DataContext;
  </code></pre>
  
  <p>Where <code>item</code> is a simple POCO that has a <code>Name</code> property of type <code>string</code> (this part works, I've traced it, i.e. the DataContext is correctly assigned).</p>
  
  <p>But the <strong>data binding</strong> never occurs. Is it by design (i.e. no data binding inside a content template), if not what's wrong? Thanks,</p>