I have a TabControlrelated ICollectionViewone that matters ObservableCollection<EditorTabViewModel>. I think the standard MVVM Multi-Document template? In any case, it EditorTabViewModelhas a property Contentthat contains a string to display. I found that binding works ...
_tabs.Add(new EditorTabViewModel { Content = "Tab 1" });
_tabs.Add(new EditorTabViewModel { Content = "Tab 2" });
Its values are displayed correctly
Xaml
<DataTemplate DataType="{x:Type vm:EditorTabViewModel}">
<me:MarkdownEditor
TextContent="{Binding Path=Content.Content, RelativeSource={RelativeSource Mode=TemplatedParent}, Mode=TwoWay}"
Options="{Binding Path=Options, RelativeSource={RelativeSource AncestorType={x:Type Window}}}" />
</DataTemplate>
Result

But when I change the value, switch the tabs and return, I again get the line set in the constructor ... shown in this video (on screen)
Visual studio solution
source
share