0
我在我的ListBoxItem的样式中使用MouseBindings。ListBoxItem偷鼠标单击列表框
<MouseBinding MouseAction="LeftClick" Command="{Binding
DataContext.ViewWorkingImprovementAssetCommand}" CommandParameter="{Binding}"/>
具体来说,我使用LeftClick命令来激发视图模型中的命令。问题是该项目没有在列表框中被选中,因为鼠标事件没有进入列表框。那么有没有办法将事件传递给父控件(ListBox)?
如果我在SelectionChanged的ListBox上使用交互触发器,但可以重新点击已经选择的项目不会像名称所示那样触发事件,我可以让这件事情起作用。而当我的名单只有一个问题的项目。
<i:Interaction.Triggers>
<i:EventTrigger EventName="SelectionChanged">
<i:InvokeCommandAction Command="{Binding ViewWorkingImprovementAssetCommand}"
CommandParameter="{Binding ElementName=RemovedImprovementAssetsListBox, Path=SelectedItem}" />
</i:EventTrigger>
</i:Interaction.Triggers>
任何想法?
我认为,我们需要看到的XAML – Phil 2012-03-29 19:08:07
正确回答自己的问题,接受的答案拍摄,答案并不在问题的归属。 – 2012-04-12 23:07:15