我有这个问题。我在 WPF 中使用 caliburn micro。在视图中,我有列表框,并且在视图模型中绑定了事件 MouseDoubleClick 方法。我想发送作为参数选择的列表框项目。但我不知道该怎么做。
鉴于我有这个:
<ListBox Name="Friends"
SelectedItem="Key"
Style="{DynamicResource friendsListStyle}"
Grid.Row="2"
Margin="4,4,4,4"
Micro:Message.Attach="[MouseDoubleClick]=[Action SendRp(Key)]"
PreviewMouseRightButtonUp="ListBox_PreviewMouseRightButtonUp"
PreviewMouseRightButtonDown="ListBox_PreviewMouseRightButtonDown"
MouseRightButtonDown="FriendsListBoxMouseRightButtonDown"/>
在视图模型中我有这个方法:
public void SendRp(string key)
{
MessageBox.Show(key);
}
任何提前,谢谢。