i want to make a CommandParameter Binding to another ViewModel then the Command is. The Commands Binding steps out of the collection of the treeview to the ViewModel that contains the "Items" - Collection. But the CommandParameter should pass the ViewModel from the "Children". If i just do {Binding} it passes the wrong ViewModel. (the one where the "Items" Collection is)
<TreeView
ItemsSource="{Binding Items}">
<TreeView.ItemTemplate>
<HierarchicalDataTemplate ItemsSource="{Binding Children}">
<StackPanel Orientation="Horizontal"
CanHorizontallyScroll="True">
<CheckBox VerticalAlignment="Center"
IsChecked="{Binding IsSelected}"/>
<TextBlock VerticalAlignment="Center"
FontSize="14"
Text="{Binding Name}"/>
</StackPanel>
</HierarchicalDataTemplate>
</TreeView.ItemTemplate>
<TreeView.ContextMenu>
<ContextMenu>
<MenuItem Header="Set Script-Root"
Command="{Binding Path=DataContext.SomeCommand, RelativeSource={RelativeSource AncestorType=ContextMenu}}"
CommandParameter="{Binding HOW_TO_VIEWMODEL_of_TREEVIEW-ITEMS???}"/>
</ContextMenu>
</TreeView.ContextMenu>
</TreeView>