ItemSelectionChanged不调用命令操作(Xceed.Wpf.Toolkit)-MVVM

时间:2018-10-10 17:33:44

标签: c# mvvm wpf-controls wpftoolkit

我一直在到处搜索,但无法解决我的问题(不确定我是否正在寻找简单的问题)。无论如何,我遇到的问题是未在CheckListBox上(从Xceed.Wpf.Toolkit中)调用命令动作,请参阅以下内容:

<wpftk:CheckListBox Grid.Column="0" Grid.Row="1" Grid.RowSpan="9" Width="250" Height="175" TabIndex="0" VerticalAlignment="Top"
                     ItemsSource="{Binding Path=GetAdminManagedDepartments}"
                     SelectedItemsOverride="{Binding SelectedDepartments, Mode=TwoWay}">
   <i:Interaction.Triggers>
     <i:EventTrigger EventName="ItemSelectionChanged">
        <i:InvokeCommandAction Command="{Binding Path=SelectionCommand}"/>
     </i:EventTrigger>
   </i:Interaction.Triggers>
</wpftk:CheckListBox>

但是,在调用同一命令时,组合框的以下内容将非常适用:

           <ComboBox Grid.Column="2" Grid.Row="1" Height="29" Width="230" FontSize="14" IsEditable="True" VerticalAlignment="Top" TabIndex="1" 
                      ItemsSource="{Binding GetAllAbsenceTypes}"
                      Text="{Binding Path=TYPE_ABSENCE, UpdateSourceTrigger=PropertyChanged, Mode=TwoWay}"
                      SelectedItem="{Binding Path=TYPE_ABSENCE, Mode=TwoWay}"
                      ItemContainerStyle="{StaticResource ComboBoxItemStyle}">
                <i:Interaction.Triggers>
                    <i:EventTrigger EventName="SelectionChanged">
                        <i:InvokeCommandAction Command="{Binding Path=SelectionCommand}" />
                    </i:EventTrigger>
                </i:Interaction.Triggers>
            </ComboBox>

在这方面的任何帮助将不胜感激。

0 个答案:

没有答案