【发布时间】:2010-11-27 19:34:10
【问题描述】:
我正在尝试调整 Windows Phone 7 TrainingKit (http://www.microsoft.com/downloads/en/details.aspx?displaylang=en&FamilyID=ca23285f-bab8-47fa-b364-11553e076a9a) 中包含的 UsingBingMaps 示例以使用 MVVM-Light 工具包。我正在尝试使用 EventToCommand 为 Pushpin 的 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 对象一起使用?
【问题讨论】:
标签: windows-phone-7 mvvm-light bing-maps