Different Datacontext for Command and CommandParameter
问题 Is it possible to have a different Datacontext for a WPF Command and a CommandParameter ? <UserControl> <UserControl.Resources> <viewmodels:ListViewGridBaseViewModel x:Key="vm" /> </UserControl.Resources> <Grid> <ContentControl x:Name="currentContent" Content="{Binding Path=ListGrid}" > <ContentControl.ContextMenu> <ContextMenu > <MenuItem Command="{Binding Path=Save}" CommandParameter="{Binding ElementName=currentContent}" DataContext="{StaticResource ResourceKey=vm}" Header="Save">