我有这个代码,我想添加鼠标左键单击绑定。 我已经这样做了,但由于某种原因接缝已经生效了。
<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>
我做错了吗?这样做有什么外在的方式吗?