I have a small winform application that uses a WPF usercontrol to show a bing map on my winform. I can add a single pushpin, and set the location zoom etc,,
This is my xaml file :
<UserControl x:Class="MyBingWinForm.MyMapControl"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:m="clr-namespace:Microsoft.Maps.MapControl.WPF;assembly=Microsoft.Maps.MapControl.WPF">
<Grid>
<m:Map Name="Map"/>
</Grid>
My C# file looks like this :
namespace MyBingWinForm
{
public partial class MyMapControl
{
public MyMapControl()
{
InitializeComponent();
Map.Center = new Location(55.6760970, 12.5683370);
Pushpin pin = new Pushpin();
pin.Location = new Location(55.6760970, 12.5683370);
Map.ZoomLevel = 12;
// Adds the pushpin to the map.
Map.Children.Add(pin);
// Removes pushpin from the map.
// myMap.Children.Remove(pin);
}
}
}
I want to add multiple pushpins to the map, in some kind of iteration, thinking having a class with longitude and latitude or a sctruct, maybe an array.
Another wish is that the first pushpin in the list have a different look that the others but that is another question.
I hope some body can give me a small guide or lead me the right way. I am working in visual Studio 2012