Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/293.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# WPF交互事件触发器_C#_Wpf_Combobox_Ribbon - Fatal编程技术网

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}" >

有什么想法吗?谢谢