绑定MapCenter坐标:Center为null

时间:2013-07-10 12:06:22

标签: windows-phone-7 data-binding map windows-phone-8

我有Jeff Wilcox静态地图控件:

<jwMaps:StaticMap
            VerticalAlignment="Top"                                   
            Margin="-12,0,-12,0"
            Provider="Bing"                                    
            Foreground="{StaticResource PhoneAccentBrush}"
            Height="200"
            ZoomLevel="1"
            Visibility="Visible"
            MapCenter="{Binding Coordinates}" />

但我有错误System.ArgumentException: Center is null。在这种情况下如何设置默认坐标?坐标有GeoCoordinate类型。

1 个答案:

答案 0 :(得分:0)

把它放在代码中 将name属性添加到StaticMap示例Name =“staticMap” 然后staticMap.MapCenter =坐标;