Binding ItemSource
to a stack of FreeResponseEditViewModel, the DataTemplate creates FreeResponseEdit
and then injects the FreeResponseEditViewModel
into the view as a DataContext automatically.
<dock:DockingManager.LayoutItemTemplateSelector>
<selector:LayoutItem>
<selector:LayoutItem.ProblemEditViewTemplate>
<DataTemplate>
<problem:FreeResponseEdit />
</DataTemplate>
</selector:LayoutItem.ProblemEditViewTemplate>
</selector:LayoutItem>
</dock:DockingManager.LayoutItemTemplateSelector>
The DataContext
is omitted altogether.