Windows phone 7 带EventToCommand的图钉

Windows phone 7 带EventToCommand的图钉,windows-phone-7,mvvm-light,bing-maps,Windows Phone 7,Mvvm Light,Bing Maps,我正在尝试调整WindowsPhone7培训工具包()中包含的UsingBingMaps示例,以使用MVVMLightToolkit。我正在尝试使用EventToCommand为图钉的MouseLeftButtonUp事件设置一个命令,但该命令没有执行。以下是图钉的代码: <my:Pushpin Style="{StaticResource PushpinStyle}" Location="{Binding L

我正在尝试调整WindowsPhone7培训工具包()中包含的UsingBingMaps示例,以使用MVVMLightToolkit。我正在尝试使用EventToCommand为图钉的MouseLeftButtonUp事件设置一个命令,但该命令没有执行。以下是图钉的代码:

<my:Pushpin Style="{StaticResource PushpinStyle}"                                        
Location="{Binding Location}"
Background="{Binding TypeName, Converter={StaticResource PushpinTypeBrushConverter}}">
<i:Interaction.Triggers>
  <i:EventTrigger EventName="MouseLeftButtonUp">
    <cmd:EventToCommand Command="{Binding DataContext.PushpinClickCommand, ElementName=HomePage}"/>
  </i:EventTrigger>
</i:Interaction.Triggers>
<Image Source="{Binding Icon}" />
</my:Pushpin>


我遗漏了什么吗?是否有人能够将EventToCommand与Pushpin对象一起使用?

您试图对该命令执行什么操作

我可以用这个命令启动,但我似乎无法从传递的参数中获取对象的详细信息

我已经在silverlight中使用了它,我认为它在WP7中可以直接使用(如果我弄错了,请纠正我)


在我的viewmodel构造函数中

PolySelCommand = new RelayCommand<MouseButtonEventArgs>(PolySelCommandExecute);
PolySelCommand=newrelaycommand(PolySelCommandExecute);
在viewmodel类中

public RelayCommand<MouseButtonEventArgs> pinSelCommand{ get; set; }
private voidpinSelCommandExecute(MouseButtonEventArgs e)
{
   // < Your code >
}
public RelayCommand pinSelCommand{get;set;}
专用voidpinSelCommandExecute(鼠标按钮Ventargs e)
{
//<你的代码>
}

希望这能有所帮助。如果您解决了如何传递对象详细信息的问题,请发回,因为我有问题

您试图用该命令做什么

我可以用这个命令启动,但我似乎无法从传递的参数中获取对象的详细信息

我已经在silverlight中使用了它,我认为它在WP7中可以直接使用(如果我弄错了,请纠正我)


在我的viewmodel构造函数中

PolySelCommand = new RelayCommand<MouseButtonEventArgs>(PolySelCommandExecute);
PolySelCommand=newrelaycommand(PolySelCommandExecute);
在viewmodel类中

public RelayCommand<MouseButtonEventArgs> pinSelCommand{ get; set; }
private voidpinSelCommandExecute(MouseButtonEventArgs e)
{
   // < Your code >
}
public RelayCommand pinSelCommand{get;set;}
专用voidpinSelCommandExecute(鼠标按钮Ventargs e)
{
//<你的代码>
}
希望这能有所帮助。如果你解决了如何传递对象详细信息,请发回,因为我有问题