View层:
xmlns:i=http://schemas.microsoft.com/expression/2010/interactivity
<ComboBox x:Name="comboBox1" Height="23" Width="120" SelectedValuePath="StuId" DisplayMemberPath="StuName" ItemsSource="{Binding StudentList}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding SelectItemChangedCommand}"/>
</i:EventTrigger>
</i:Interaction.Triggers>
</ComboBox>
ViewModel层:
public ICommand SelectItemChangedCommand { get; set; }
构造函数中
SelectItemChangedCommand = new ActionCommand(this.NotifySelectedItemChanged);
事件7a686964616fe78988e69d8331333332613730:
public void NotifySelectedItemChanged()
{
MessageBox.Show("Sucess");
}