У вас есть 2 пути:
(1) Создать любой элемент UIE для передачи в PushPinLayer.AddChild. Метод AddChild будет принимать и любой UIElement, такой как этот Grid, содержащий изображение и TextBlock:
MapLayer m_PushpinLayer = new MapLayer();
Your_Map.Children.Add(m_PushpinLayer);
Image image = new Image();
image.Source = ResourceFile.GetBitmap("Images/Pushpin.png", From.This);
TextBlock textBlock = new TextBlock();
textBlock.Text = "My Pushpin";
Grid grid = new Grid();
grid.Children.Add(image);
grid.Children.Add(textBlock);
m_PushpinLayer.AddChild(grid,
new Microsoft.Maps.MapControl.Location(42.658, -71.137),
PositionOrigin.Center);
(2) Создайте собственный объект PushPin для передачи в PushpinLayer.AddChild, но сначала установите его свойство Template. Обратите внимание, что PushPin являются ContentControls и имеют свойство Template, которое может быть установлено из ресурса, определенного в XAML:
MapLayer m_PushpinLayer = new MapLayer();
Your_Map.Children.Add(m_PushpinLayer);
Pushpin pushpin = new Pushpin();
pushpin.Template = Application.Current.Resources["PushPinTemplate"]
as (ControlTemplate);
m_PushpinLayer.AddChild(pushpin,
new Microsoft.Maps.MapControl.Location(42.658, -71.137),
PositionOrigin.Center);
...
<ResourceDictionary
xmlns="http://schemas.microsoft.com/client/2007"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
<ControlTemplate x:Key="PushPinTemplate">
<Grid>
<Image Source="Images/Pushpin.png" />
<TextBlock Text="My Pushpin" />
</Grid>
</ControlTemplate>
</ResourceDictionary>
Удачи,
Джим МакКарди
Face To Face Software и YinYangMoney