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