Up vote 0 down vote favorite share g+ share fb share tw.
I'm having some trouble binding this json to a ListBox...The problem seems to happen in the ActivityTrack class/object of the JSON...i'm not sure what is not meshing... {"collection":{"type":"track","created_at":"2011/09/18 14:04:00 +0000","origin":{"id":23606164,"created_at":"2011/09/18 14:03:59 +0000","user_id":222927,"duration":342465,"commentable":true,"state":"finished","sharing":"public","tag_list":"garage usgarage soulfulhouse house deephouse deep","permalink":"pablo-cortez-when-i-need-u","description":"","streamable":true,"downloadable":false,"genre":"UK Garage","release":"","purchase_url":null,"label_id":null,"label_name":"","isrc":"","video_url":null,"track_type":"demo","key_signature":"","bpm":null,"title":"Pablo Cortez - When I Need U (Back To 90s Mix)","release_year":null,"release_month":null,"release_day":null,"original_format":"mp3","license":"all-rights-reserved","uri":"https://api.soundcloud.com/tracks/23606164","permalink_url":"
GetResponseStream())) { string resultString = streamReader1.ReadToEnd(); using (var ms = new MemoryStream(Encoding.Unicode. GetBytes(resultString))) { if (ms! = null) { var ser = new DataContractJsonSerializer(typeof(Activities)); Activities obj = (Activities)ser.
ReadObject(ms); userDashboardActivities = null; userDashboardActivities = new ObservableCollection(); for (int I = 0; I mainMessage. Text = messageDashboard); } else { messageDashboard = ""; UIThread. Invoke(() => mainMessage.
Text = messageDashboard); UIThread. Invoke(() => dashboardBox. ItemsSource = userDashboardActivities); } } } } } catch (WebException we) { UIThread.
Invoke(() => MessageBox. Show("Could not retrieve the latest. Internet down?
Try a refresh. ")); } } } please check it out! Thanks in advance!
Json windows-phone-7 listbox soundcloud link|improve this question edited Sep 19 '11 at 6:30Claus Jørgensen10.4k41238 asked Sep 19 '11 at 2:32ice9111756.
2 You have called your property activities but the json calls it collection. Is there a missing mapping file you didn't include? Or is the problem as simple as this?
– Chris Sainty Sep 19 '11 at 5:40 1 What happens with your code? Is an exception thrown? Nothing happens?
Please give us some more information! – ColinE Sep 19 '11 at 7:28 @ColinE - Sorry, the code throws an exception when I try to access obj. Activities -- obj.activities.
Length and userDashboardActivities. Add(obj. Activitiesi); NullReferenceException because Activites never got filled with information from the json – ice911 Sep 19 '11 at 15:07 @Chris Sainty - You are the man!
Thanks for the second pair of eyes! – ice911 Sep 19 '11 at 15:20 @Chris Sainty - post an Answer so I can award this question to you as Answered. Thanks again!
– ice911 Sep 19 '11 at 15:36.
Answer as discovered in the comments. You have called your property activities but the json calls it collection.
Thanks again! Can't believe I missed that! Looked it over like 100 times before I posted the question.
– ice911 Sep 20 '11 at 17:16.
I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.