は、タイトルが本当に正しいのですが、これは問題であるかどうかわからない... 設置方法は
私はプッシュピンコレクションを移入foreachループを持っています。私は、XML要素の1つ(Latitude)で「仕事」を行う必要があります。 「仕事」はコメントアウトされています。問題は、どこにこれらのタスク/変数をどこに置くべきかわかりません。どこに置いても、私はさまざまなエラーが出ます。私は必要に応じてもっと詳しく説明することができますが、これを実行するより良い方法があるかどうか疑問に思っています。私は何をしようとしているのかわからないが、もっと説明が必要なのかどうか私に知らせてください。どんな提案も大歓迎です。public void OnOpenReadCompleted(object sender, OpenReadCompletedEventArgs e)
{
var document = XDocument.Load(e.Result);
if (document.Root == null)
return;
var events = from ev in document.Descendants("item")
.Where(ev => ev.Element("category") != null)
select new
{
Title = (ev.Element("title").Value),
Description = (ev.Element("description").Value),
Category = (ev.Element("category").Value),
Latitude = (ev.Element("link").Value),
};
ObservableCollection<Eng> pushPinCollection = new ObservableCollection<Eng>();
foreach (var ev in events)
{
Eng PushPin = new Eng
(ev.Title, ev.Description, ev.Category)
// Lat1 = (ev.Latitude),
// var items = Lat1.Split('?')[1].Split('&').Select(i => i.Split ('=')).ToDictionary(o => o[0], o => o[1]);
// var lon = items["lon"];
// var lat = items["lat"];
// var lat1 = Convert.ToDouble(lat);
// var lon1 = Convert.ToDouble(lon);
{
//Location value below is System.Device.location.Geocoordinate Eng Location
Location = new GeoCoordinate(lat1, lon1),
Title = ev.Title,
Description = ev.Description,
Category = ev.Category
};
pushPinCollection.Add(PushPin);
}
pushPins = pushPinCollection;
mapItems.ItemsSource = PushPins;
}
をあなたはどのような「エラーのvarity」を見ているこの問題に対処する方法はいくつかありますか? – Keltex
これを実際に働いて、基本的に私はポジションのすべての組み合わせを試してみました。働いていたものとは別に! –