【发布时间】:2012-02-07 14:37:25
【问题描述】:
我尝试为 windows phone google maps 制作自己的图钉。它可以在 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>
为什么这不起作用:/?
【问题讨论】:
标签: c# .net windows-phone-7 xaml