Skip to content

Removing Latebinding using Pushpins to Bing Maps in WP7

May 17, 2011

 

Here I have specified an Bing Map Control XAML in WP7, and if you wish to add a pushpin with the content “you” on the map, the best way is inside that map control: –

<map Name="Map" CredentialsProvider="{Binding CredentialsProvider}" ZoomLevel="{Binding Zoom, Mode=TwoWay}" Center="{Binding Center, Mode=TwoWay}">

</map>

You write the following code:-

<map:MapLayer Visibility=”{Binding UserPosition, Converter={StaticResource GeoCoordinateVisibilityConverter}}”>

<map:Pushpin Location=”{Binding UserPosition}” Content=”you” />

</map:MapLayer>

This allows you to insert a pushpin in a layer, and collapses the layer as well, thus reduces the need for late-binding for setting a data context in Loaded event.

Hope that helps.

Advertisements

From → Uncategorized

Leave a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: