0
votes

I have tried to make my own pushpin for windows phone google maps. It works to draw an ellipse , rectangle or textblock in xaml but when i try to make the pushpin an image,i dont see anything.

My Main Code:

<m:MapItemsControl x:Name="Pushpins" ItemsSource="{Binding Pushpins}" >
    <m:MapItemsControl.ItemTemplate>
        <DataTemplate>
            <m:Pushpin Name="Pin" 
                       Template="{StaticResource PushpinTemplate}" 
                       Location="{Binding Position}"  />
        </DataTemplate>
    </m:MapItemsControl.ItemTemplate>
</m:MapItemsControl>

My Resources file:

<ControlTemplate x:Key="PushpinTemplate" TargetType="m:Pushpin">
    <Grid Height="24" Width="24" Margin="0">
        <TextBlock Text="Hej"/>
        <Image Source="/Icons/Bird_PushPin.png" Stretch="Fill"/>
    </Grid>
</ControlTemplate>

Why isn't this working :/ ?

1

1 Answers

0
votes

Found the answer.

There was nothing wrong with the code, but in the VS2010 project i had to set the Build Action of the image to "Content" instead of "Resource" ...