【发布时间】:2010-10-31 07:59:23
【问题描述】:
对于那些做纯 MVVM 的人,如何处理 ComboBox SelectionChanged 事件而不返回到后面的代码?
我试过了,例如AttachedBehaviors but Event="SelectedChanged" 不受支持:
<ComboBox>
<ComboBoxItem Content="Test1">
<c:CommandBehaviorCollection.Behaviors>
<c:BehaviorBinding Event="SelectionChanged"
Command="{Binding SelectedChanged}"
CommandParameter="MainBorder123"/>
</c:CommandBehaviorCollection.Behaviors>
</ComboBoxItem>
<ComboBoxItem Content="Test2"/>
<ComboBoxItem Content="Test3"/>
</ComboBox>
【问题讨论】:
标签: wpf events mvvm attachedbehaviors