0
我在地图上有几个图钉。当我用鼠标悬停在图钉上时,我得到一个包含一些信息的对话框。现在我还想要一些额外的信息,当我点击相同的图钉。但我真的不知道如何做到这一点。我尝试了一些东西,但它没有工作......bing地图图钉和鼠标点击
这是我的代码:
<bing:MapItemsControl ItemsSource="{Binding Items}">
<bing:MapItemsControl.ItemTemplate>
<DataTemplate>
<bing:Pushpin bing:MapLayer.Position="{Binding Location}" Background="{Binding Color, Converter={StaticResource brushConverter}}">
<ToolTipService.ToolTip>
<StackPanel>
<TextBlock Text="{Binding Address}" />
<TextBlock Text="{Binding Description}" />
</StackPanel>
</ToolTipService.ToolTip>
</bing:Pushpin>
</DataTemplate>
</bing:MapItemsControl.ItemTemplate>
</bing:MapItemsControl>
</bing:Map>
曾有人试图这样做或不知道如何做到这一点,迄今为止的感谢!
您应该只能使用模板绑定来覆盖默认值。在堆栈面板内添加你想要的任何额外内容。 – jstell