title: Binding the title of a LayoutDocument from a collection in AvalonDock 2.0
body: <p>I'm binding an ObservableCollection to AvalonDock 2.0, where every item in the collection is an AvalonDock Document. This is how I do the binding:</p>
  
  <pre><code>&lt;ad:DockingManager DocumentsSource="{Binding Path=OpenProjects, Mode=TwoWay}" ActiveContent="{Binding Path=CurrentProject, Mode=TwoWay}" LayoutItemTemplateSelector="{StaticResource ProjectTemplateSelector}"&gt;
  ...
  &lt;/ad:DockingManager&gt;
  </code></pre>
  
  <p>The problem is I want to show the Name of each item (which is specified in the property <code>Name</code> in <code>CurrentProject</code>) as the Document title. This is what I've tried:</p>
  
  <pre><code>&lt;ad:DockingManager.DocumentHeaderTemplate&gt;
      &lt;DataTemplate&gt;
          &lt;TextBlock DataContext="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType=ad:DockingManager}, Path=ActiveContent, Mode=OneWay}" Text="{Binding Path=Name}" /&gt;
      &lt;/DataTemplate&gt;
  &lt;/ad:DockingManager.DocumentHeaderTemplate&gt;
  </code></pre>
  
  <p>This works fine if I only have one document open, but when I have several, they all show the <code>Name</code> of the current project. For example, if I have four open projects, with the names "A", "B", "C" and "D", if I'm currently viewing the document "C", all four tabs will show the title "C", and when I change to document "B", they will all change its names to "B".</p>
  
  <p>Is there any way to prevent this changes? I've tried setting the binding mode to <code>OneTime</code>, but it doesn't seem to work.</p>