If I have a data template as follows,
<DataTemplate DataType="{x:Type vm:EditorTabViewModel}"> <me:MarkdownEditor TextContent="{Binding Path=Content, RelativeSource={RelativeSource AncestorType={x:Type vm:EditorTabViewModel}}}" ... /> </DataTemplate> I wonder why Relative source can't find the EditorTabViewModel? Its just referring to the data template?
UPDATE 1
The below works tho
<me:MarkdownEditor TextContent="{Binding Path=Content.Content, RelativeSource={RelativeSource Mode=TemplatedParent}}" /> Binding Path=Content.Content ^ Refers to EditorTabViewModel.Content ^ refers to EditorTabViewModel Is there a more ituitive markup? lol, i'd thought RelativeSource={RelativeSource Mode=TemplatedParent}}" already refers to EditorTabViewModel at first