I have a ContextMenu (from the Silverlight Toolkit) inside a DataTemplate used as the ItemTemplate of a ListBox:
<DataTemplate x:Key="BillItemDataTemplate">
<Grid Margin="0,0,0,12" x:Name="ItemGrid">
<kit:ContextMenuService.ContextMenu>
<kit:ContextMenu>
<kit:MenuItem Header="delete item"
Command="{Binding ???????.DeleteItemCommand}"
CommandParameter="{Binding}" />
</kit:ContextMenu>
</kit:ContextMenuService.ContextMenu>
[...]
</Grid>
</DataTemplate>
How can I tell the ContextMenu.Command to bind to a property on the view-model exposed by the outer DataContext (i.e. the one that applies to the ListBox)? If I'm right, I cannot use WPF relative declarations as explained here.
I would prefer if my child view-models wouldn't require a reference to the "parent" view-model.