経度と緯度を束縛できませんか?ビン地図経度緯度データバインディング
<bm:Map x:Name="EventMap" MapType="Birdseye" ZoomLevel="5"
Credentials="xxxxxxxxxxxxxxxxxxxxxxxxxxxxx" Height="480" Width="550"
HorizontalAlignment="Left">
<bm:Map.Center>
<bm:Location Latitude="{Binding Latitude}"
Longitude="{Binding Longitude}"/>
</bm:Map.Center>
</bm:Map>
ここは、緯度と経度をバインドするコレクションです。
<CollectionViewSource
x:Name="itemsViewSource"
Source="{Binding EventItems}"
d:Source="{Binding EventItemGroups[0].EventItems, Source={d:DesignInstance Type=data:EventDataSource, IsDesignTimeCreatable=True}}"/>
どのような種類のデータを使用する必要がありますか?文字列?ダブルなど?
private string _longitude = string.Empty;
public string Longitude
{
get { return this._longitude; }
set { this.SetProperty(ref this._longitude, value); }
}
private string _latitude = string.Empty;
public string Latitude
{
get { return this._latitude; }
set { this.SetProperty(ref this._latitude, value); }
}
Iは(経度) "151.173248"、(緯度)信じる "-33.840764" 私は間違っていないmの場合、シドニーで有効なポイントです。
私は地図に緯度と経度が表示されていないことがわかったので、私は縛ります。それはどこの場所もない元の地図のようです。最も重要なことは、コンパイルの数時間後に、それは
を飛び出しすべてのアイデアワットが起こるBing.Maps.Location.Longitude
」プロパティに割り当てる
を失敗しましたか?
バインドしようとしている緯度と経度の値はどこですか?マップを含むUI要素に適切なDataContextを割り当てることを覚えましたか? DataContextが正しく設定されている場合、緯度と経度の値は有効ですか? –
@BojinLi 返信いただきありがとうございます。ここに情報があります。 –