2012-02-07 154 views
0

我试图让我自己的Windows手机谷歌地图图钉。它可以在xaml中绘制椭圆,矩形或文本块,但是当我尝试使图钉成为图像时,我什么都看不到。谷歌地图在Windows手机中的自定义图钉

我的主要代码:

<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> 

我的资源文件:

<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> 

为什么没有这方面的工作:/?

回答

0

找到了答案。

代码没有错,但在VS2010项目中,我必须将图像的构建动作设置为“内容”而不是“资源”...