"<device:GeoCoordinate..."
という項目のlat/lngの値を動的に設定しようとしています。私はハードXAMLのコードこの問題はないが、私はその場でそれを設定しようとしたとき、私は(下に示すロードされたハンドラ内)nullポインタ例外を取得GeoCoordinate lat + lngの値を動的に設定する方法
XAML
<maps:Map ZoomLevel="6" Mode="Aerial" Grid.Row="1" Grid.ColumnSpan="2">
<maps:Map.Center>
<device:GeoCoordinate x:Name="theLocation"/>
</maps:Map.Center>
<maps:MapLayer x:Name="TheMapLayer"/>
</maps:Map>
C#の
することができますvoid ViewBingMaps_Loaded(object sender, RoutedEventArgs e)
{
//get lat + lng for the device and set it dynamically
theLocation.Latitude = 41.5686949;
theLocation.Longitude = -93.7943157;
}
これを設定することはできますか、私はデバイスを誤解していますか?GeoCoordinate目的?