To draw lines on a map, you use the element MapPolylineas a child of the control Map. To add a marker to a control Map, you add the element Pushpinas a child of the control Map. To add multiple elements (lines or buttons), add MapItemsControlas a child of the control Mapand specify ItemsSourceand ItemTemplate.
The following code example is displayed Pushpinto display the current location and MapItemsControlto display waypoints on a route:
<maps:Map x:Name="_map"
CopyrightVisibility="Collapsed"
CredentialsProvider="Your API Key Here"
LogoVisibility="Collapsed">
<maps:MapItemsControl ItemsSource="{Binding WayPoints}">
<maps:MapItemsControl.ItemTemplate>
<DataTemplate>
<maps:Pushpin Background="{Binding BackgroundBrush}" Location="{Binding Location}"/>
</DataTemplate>
</maps:MapItemsControl.ItemTemplate>
</maps:MapItemsControl>
<maps:Pushpin x:Name="_current" Background="Blue" Location="{Binding CurrentLocation}"/>
</maps:Map>
This blog post can also help you get started.
source
share