Mapping and Location in Windows Phone: Listing 2

XAML for the MapItemsControl, which is data bound to the Cities property.

<maps:Map LogoVisibility="Collapsed"
            CredentialsProvider="{StaticResource Credentials}">
    <maps:Pushpin x:Name="MyLocationPushPin" Content="Here I Am!"
                    Location="{Binding CurrentLocation}" />
    <maps:MapItemsControl ItemsSource="{Binding Cities}">
            <DataTemplate x:Key="CityItemTemplate">
                <maps:Pushpin Location="{Binding Location}">
                    <Grid MaxHeight="30" MaxWidth="80">
                        <Image Source="{Binding ImageUrl}" Stretch="UniformToFill"/>
                        <TextBlock Text="{Binding Name}" Foreground="Black" />
            <StaticResource ResourceKey="CityItemTemplate"/>

About the Author

Nick Randolph runs Built to Roam, a consulting company that specializes in training, mentoring and assisting other companies build mobile applications. With a heritage in rich client applications for both the desktop and a variety of mobile platforms, Nick currently presents, writes and educates on the Windows Phone platform.