C# WPF交互事件触发器
首先是导致问题的代码:C# WPF交互事件触发器,c#,wpf,combobox,ribbon,C#,Wpf,Combobox,Ribbon,首先是导致问题的代码: <my:Ribbon x:Name="ribbon"> <interactivity:Interaction.Triggers> <interactivity:EventTrigger EventName="SelectionChanged"> <command:EventToCommand Command="{Binding RibbonTabSelectedCommand}" P
<my:Ribbon x:Name="ribbon">
<interactivity:Interaction.Triggers>
<interactivity:EventTrigger EventName="SelectionChanged">
<command:EventToCommand Command="{Binding RibbonTabSelectedCommand}" PassEventArgsToCommand="True" />
</interactivity:EventTrigger>
</interactivity:Interaction.Triggers>
<my:RibbonTab Header="Chart" Tag="Chart"
IsEnabled="{Binding SelectedSearchResult,
Converter={StaticResource nullToBoolConverter}}">
<my:RibbonGroup>
<ComboBox ItemsSource="{Binding SelectedSearchResult.Values}"
SelectedValue="{Binding SelectedFrequency, Mode=TwoWay}">
</ComboBox>
</my:RibbonGroup>
</my:RibbonTab>
</my:Ribbon>
我要做的是使用MvvmLight框架处理RibbonTab的SelectionChanged,并将事件转换为视图模型命令。它工作得很好。
问题是,在添加ComboBox之后,ComboBox的选择更改也由该代码处理。我不想发生这种事。该功能区是来自Microsoft WPF功能区的功能区
我试过这个,但没用:
<interactivity:EventTrigger EventName="SelectionChanged" SourceName="ribbon" SourceObject="{Binding ElementName=ribbon}" >
有什么想法吗?谢谢