列表框中的WPF鼠标绑定

列表框中的WPF鼠标绑定,wpf,xaml,data-binding,listbox,Wpf,Xaml,Data Binding,Listbox,我有这个代码,我想添加鼠标左键绑定。 我是这样做的,但出于某种原因,它会产生影响 <ListBox Grid.Row="5" Grid.Column="2" IsEnabled="{Binding UserGroupUpdatePermission}" ItemsSource="{Binding UserGroupTypeList }" HorizontalAlignment="Left" VerticalAlignment="Center" VerticalContentAlignmen

我有这个代码,我想添加鼠标左键绑定。 我是这样做的,但出于某种原因,它会产生影响

<ListBox Grid.Row="5" Grid.Column="2" IsEnabled="{Binding UserGroupUpdatePermission}" ItemsSource="{Binding UserGroupTypeList }" HorizontalAlignment="Left" VerticalAlignment="Center" VerticalContentAlignment="Center" Width="300" Height="auto">
    <ListBox.InputBindings>
        <MouseBinding Command="{Binding Path = SaveCommand }" Gesture="LeftClick" />
    </ListBox.InputBindings>
    <ListBox.ItemTemplate>
        <DataTemplate>
            <CheckBox Content="{Binding Name}" IsChecked="{Binding Checked, Mode=TwoWay}"/>
        </DataTemplate>
    </ListBox.ItemTemplate>
</ListBox>

我做错什么了吗?她做这件事有什么出路吗

请同时共享包含SaveCommand的viewmodel。是否单击鼠标左键?你确定你不是在找右键点击吗?我的自然猜测是,左键单击已用于选择项目,因此命令将被覆盖是的,我需要在单击其中一个复选框时将其设置为“脏”。问题是,检查绑定是自动的,我不能添加脏变量theresave命令,它只是用于检查它可以是其他任何构造函数。我在那里设置了一个断点,程序在鼠标点击时无法到达那里