title: WPF DependencyProperty in ContentControl does not bind TwoWay
body: <p>I have custom <code>ContentControl</code></p>
  
  <pre><code>public class FilteringColumnHeader : ContentControl
  {
      public static readonly DependencyProperty TextFieldProperty =
          DependencyProperty.Register("TextField", typeof(string), typeof(FilteringColumnHeader), new FrameworkPropertyMetadata(null, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
  
      public string TextField
      {
          get
          {
              return (string)GetValue(TextFieldProperty);
          }
          set { SetValue(TextFieldProperty, value); }
      }
  }
  </code></pre>
  
  <p>With this template style</p>
  
  <pre><code>&lt;Style TargetType="{x:Type c:FilteringColumnHeader}"&gt;
      &lt;Setter Property="Template"&gt;
          &lt;Setter.Value&gt;
              &lt;ControlTemplate TargetType="{x:Type c:FilteringColumnHeader}"&gt;
                  &lt;DockPanel&gt;
                      &lt;ContentPresenter DockPanel.Dock="Top" Content="{TemplateBinding Content}" /&gt;
                      &lt;TextBox Text="{TemplateBinding TextField}"/&gt;
                  &lt;/DockPanel&gt;
              &lt;/ControlTemplate&gt;
          &lt;/Setter.Value&gt;
      &lt;/Setter&gt;
  &lt;/Style&gt;
  </code></pre>
  
  <p>And this is how I use it in <code>DataGrid</code> in XAML</p>
  
  <pre><code>&lt;DataGridTextColumn x:Name="NameColumn" Header="Name" Binding="{Binding Name}" Width="*" MinWidth="50"&gt;
      &lt;DataGridTextColumn.HeaderTemplate&gt;
          &lt;DataTemplate&gt;
              &lt;c:FilteringColumnHeader Content="{Binding }" Width="{Binding ActualWidth, ElementName=NameColumn}" TextField="{Binding DataContext.NameFilter, RelativeSource={RelativeSource AncestorType={x:Type local:GeneratorsListView}}, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"/&gt;
          &lt;/DataTemplate&gt;
      &lt;/DataGridTextColumn.HeaderTemplate&gt;
  &lt;/DataGridTextColumn&gt;
  </code></pre>
  
  <p>And GeneratorsListView</p>
  
  <pre><code>private string nameFilter = "rec";
  public string NameFilter
  {
      get { return nameFilter; }
      set
      {
          nameFilter = value;
      }
  }
  </code></pre>
  
  <p>My problem is, the <code>Text</code> binding works only OneWay. When I run the code TextBox will be filled with "rec" and when I change the <code>NameFilter</code>, the TextBox also changes. But when I type something in that box, nothing happens (setter of <code>NameFilter</code> is not being invoked at all). As you can see I've tried to set mode to <code>TwoWay</code> everywhere I could, still nothing. When I pleace regular <code>TextBox</code> inside <code>DataTemplate</code> and set the exact same Text binding, it is working.</p>