繁体   English   中英

Windows Phone中的Google地图中的自定义图钉

[英]Custom pushpin in google maps in windows phone

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

我的主要代码:

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

为什么这样不起作用:/?

找到了答案。

代码没有任何问题,但是在VS2010项目中,我不得不将图像的“生成操作”设置为“内容”而不是“资源” ...

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM