title: How to Bind To Data within a Datatemplate of a ContentControl
body: <p>I have the following simplified Example:</p>
  
  <pre><code>    &lt;Window x:Class="TemplateBinding.MainWindow"
              xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
              xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
              Title="MainWindow" Height="350" Width="525"&gt;
          &lt;Window.Resources&gt;
              &lt;ResourceDictionary&gt;
                  &lt;ResourceDictionary.MergedDictionaries&gt;
                      &lt;ResourceDictionary
                              Source="pack://application:,,,/TemplateBinding;component/PersonTemplate.xaml" /&gt;
                  &lt;/ResourceDictionary.MergedDictionaries&gt;
              &lt;/ResourceDictionary&gt;
          &lt;/Window.Resources&gt;
          &lt;Grid&gt;
              &lt;ContentControl ContentTemplate="{StaticResource PersonTemplate}" /&gt;
          &lt;/Grid&gt;
      &lt;/Window&gt;
  </code></pre>
  
  <p>With:</p>
  
  <pre><code>    &lt;ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                          xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"&gt;
  
          &lt;DataTemplate x:Key="PersonTemplate"&gt;
              &lt;Border Width="100" Height="100" Background="RosyBrown"&gt;
                  &lt;TextBlock Text="{Binding Path=FirstName}" VerticalAlignment="Center" TextAlignment="Center"/&gt;
              &lt;/Border&gt;
          &lt;/DataTemplate&gt;
  
      &lt;/ResourceDictionary&gt;
  </code></pre>
  
  <p>as my DataTemplate in a separate ResourceDictionary file.</p>
  
  <p>I set my DataContext in the Construcor of my MainWindow and have verified it by just displaying the first name like this: <code>&lt;ContentControl Grid.Row="1" Content="{Binding FirstName}"/&gt;</code>.</p>
  
  <p>In an other scenario wher I use a DataTemplate with a <code>ListBox</code> I do the Binding exactly the same way in my DataTemplate and it just works.</p>
  
  <p>I know that the DataTemplate is working except the binding because it correctly shows the size and background color.</p>
  
  <p>What am I doing wrong? How would the Binding in my DataTemplate have to look?</p>