MVVM下鼠标右键菜单命令通过桥接的方式绑定上下文
<Grid Tag="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type UserControl}}}">
<Grid.ContextMenu>
<ContextMenu>
<MenuItem
Command="{Binding RelativeSource={RelativeSource Mode=FindAncestor, AncestorType={x:Type ContextMenu}}, Path=PlacementTarget.Tag.DataContext.ExtractToSubGraphCommand}"
CommandParameter="{Binding}"
Header="提取" />
</ContextMenu>
</Grid.ContextMenu>
</Grid>