为什么不ListView.InputBindings
工作?ListView InputBinding MouseBinding不起作用
我以相同的方式实施Interaction.Triggers
,它工作得很好。
<ListView Name="listView1" ItemsSource="{Binding Cars}">
<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseClick">
<i:InvokeCommandAction Command="{Binding ItemSelectCommand}" CommandParameter="{Binding ElementName=listView1,Path=SelectedItem}" />
</i:EventTrigger>
</i:Interaction.Triggers>
<ListView.InputBindings>
<MouseBinding Gesture="LeftClick" Command="{Binding ItemSelectCommand}" CommandParameter="{Binding ElementName=listView1,Path=SelectedItem}"/>
</ListView.InputBindings>
</ListView>
真的不想当@ Grx70在此答案的评论提到,在父定义的LeftClick
鼠标手势使用额外assmebly是否应该没有(System.Windows.Interactivity
为Interaction.Triggers
)
是否可以在ListViewItem上使用InputBindings而不是ListView?只是一个想法。 – 2015-02-06 09:40:51