I have a tab control
<TabControl Height="Auto" Grid.Row="1" ItemsSource="{Binding Tabs}" IsSynchronizedWithCurrentItem="True">
This is due to Tabsc ViewModel. I also used CollectionViewSourceto focus tabs
protected ObservableCollection<TabViewModel> _tabs;
protected ICollectionView _tabsViewSource;
public ObservableCollection<TabViewModel> Tabs
{
get { return _tabs; }
}
public void OnTabsChanged(object sender, NotifyCollectionChangedEventArgs e)
{
if (e.NewItems != null && e.NewItems.Count > 0)
foreach (TabViewModel tab in e.NewItems)
{
tab.CloseRequested += OnCloseRequested;
_tabsViewSource.MoveCurrentTo(tab);
}
if (e.OldItems != null && e.OldItems.Count > 0)
foreach (TabViewModel tab in e.OldItems)
tab.CloseRequested -= OnCloseRequested;
}
When I have more than one tab, when I create new tabs, the tabs are focused correctly

when there are no tabs, the new tabs do not seem to focus properly. pay attention to the tab title

how can i fix this? or what causes this behavior? a text box is displayed (tab contents), but the title does not appear as its selected
UPDATE
It works with a fresh file / project ... hmm ... there must be some kind of related code ... I could redo this part ...