<ListBox x:Name="Lb"
HorizontalAlignment="Left"
Height="600"
VerticalAlignment="Top"
Width="300"
Margin="145,138,0,0">
<ListBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding }">
<TextBlock.InputBindings>
<MouseBinding MouseAction="LeftDoubleClick"
Command="{Binding DataContext.cmd, RelativeSource= { RelativeSource AncestorType=Window}}" />
</TextBlock.InputBindings>
</TextBlock>
</DataTemplate>
</ListBox.ItemTemplate>

</ListBox>

源码:https://files.cnblogs.com/files/chlm/ListboxItem%E5%8F%8C%E5%87%BB%E7%BB%91%E5%AE%9A.rar

05-26 19:55