listbox或datagrid内容双击事件绑定

====listbox===

<DataTemplate>
<Border Width="350"
Height="230"
Margin="2"
Background="{DynamicResource Common.UC.Background.Dark}">
<Border.InputBindings>//绑定事件
<MouseBinding Command="{Binding DetailShowCommand}" MouseAction="LeftDoubleClick" />
</Border.InputBindings>

===datagrid====

<i:Interaction.Triggers>
<i:EventTrigger EventName="MouseDoubleClick">
<i:InvokeCommandAction Command="{Binding DoubleClickCommand}" CommandParameter="{Binding ElementName=dgvDeploys, Path=SelectedItem}" />
</i:EventTrigger>
</i:Interaction.Triggers>

原文地址:https://www.cnblogs.com/zsx-blog/p/9264177.html