TextBox
<TextBox>
<TextBox.InputBindings>
<MouseBinding Gesture="RightClick" Command="{Binding MyCommand}" />
</TextBox.InputBindings>
</TextBox>
ListBox
Nuget加载库 System.Windows.Interactivity.WPF
<ListBox x:Name="lst" ItemsSource="{Binding GradeKeChengList}" Grid.Row="1" Grid.Column="0" >
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction x:Name="abc" Command="{Binding YourCommand}"
CommandParameter="{Binding ElementName=lst, Path=SelectedItem}" >
</i:InvokeCommandAction>
</i:EventTrigger>
</i:Interaction.Triggers>
</ListBox>
另一种方式
<!--鼠标左键双击-->
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Path=Text}" ToolTip="鼠标左键双击,采集本年度!">
<TextBlock.InputBindings>
<MouseBinding Command="{Binding DataContext.SelectListBoxItemCommand, ElementName=mainWin }"
CommandParameter="{Binding ElementName=lst}"
MouseAction="LeftDoubleClick"></MouseBinding>
</TextBlock.InputBindings>
</TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>