
Ahh thank you, I see now. What's happening is that TabbedMdiHost defines a default TabItemContainerStyle of this:
<Style TargetType="docking:AdvancedTabItem">
<Setter Property="Header" Value="{Binding TabTextResolved}" />
<Setter Property="HeaderTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource TitleConverter}}" TextTrimming="CharacterEllipsis" TextWrapping="NoWrap" VerticalAlignment="Center" />
</DataTemplate>
</Setter.Value>
</Setter>
</Style>
That puts the tab text in the Header property and supplies a HeaderTemplate.
Your TabControlTemplateSelector is getting pushed down to be the HeaderTemplateSelector, however the presence of a HeaderTemplate will override a HeaderTemplateSelector, so the selector is never called into.
To get it working, add this to Window.Resources:
<Style x:Key="DockingWindowAdvancedTabItemStyle" TargetType="docking:AdvancedTabItem">
<Setter Property="Header" Value="{Binding DataContext}" />
<Setter Property="HeaderTemplateSelector" Value="{StaticResource TabControlTemplateSelector}" />
</Style>
That new Style removes the HeaderTemplate setter and adds one for HeaderTemplateSelector in its place. Then reference it in your TabbedMdiHost like this:
TabItemContainerStyle="{StaticResource DockingWindowAdvancedTabItemStyle}"
After that, the view model will be properly fed into your selector and you'll see the dynamic templates working.