1

I want to bind my pushpins (which is a list ) to the My Map`s Maplayer.

There is no such thing "ItemSource" in MapLayers attributes. How can I bind my Pushpin List Data to MapLayer?

<my:Map HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Name="map1" CredentialsProvider="KEY" >
    <my:Map.Children>
         <my:MapLayer x:Name="pushPinMapLayer" ??Binding what???}">
         </my:MapLayer>
    </my:Map.Children>
</my:Map>
4

1 回答 1

1

请参阅下面的链接,因为它来自我不久前提出的一个问题(它的哪一部分应该解决您的问题)

绑定图钉

我认为最能帮助您的部分是 Xaml(在 Map>ItemsControl 元素中)

    <my:Map Height="520" HorizontalAlignment="Left" Margin="6,6,0,0" Name="map1" VerticalAlignment="Top" Width="468" ZoomBarVisibility="Collapsed" ZoomLevel="1" CredentialsProvider="{Binding bingMapsCredentials}" >
        <my:MapLayer x:Name="myPushpinLayer"> 
             <my:MapItemsControl Name="Pushpinsss" ItemTemplate="{StaticResource LogoTemplate}" ItemsSource="{Binding PushpinCollection}" >
                 </my:MapItemsControl> 
        </my:MapLayer>
    </my:Map> 

您需要在 MapLayer 下添加 MapItemsControl 部分

于 2012-05-04T10:06:20.210 回答