Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6584995
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T16:36:24+00:00 2026-05-25T16:36:24+00:00

I’m having some trouble binding this json to a ListBox…The problem seems to happen

  • 0

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":"http://soundcloud.com/pablocortez/pablo-cortez-when-i-need-u","artwork_url":null,"waveform_url":"http://w1.sndcdn.com/wuiZilHRZhl6_m.png","user":{"id":222927,"permalink":"pablocortez","username":"Pablo Cortez","uri":"https://api.soundcloud.com/users/222927","permalink_url":"http://soundcloud.com/pablocortez","avatar_url":"http://i1.sndcdn.com/avatars-000000771958-y059w8-large.jpg?ca13f03"},"stream_url":"https://api.soundcloud.com/tracks/23606164/stream","user_playback_count":1,"user_favorite":false,"playback_count":28,"download_count":0,"favoritings_count":0,"comment_count":2,"attachments_uri":"https://api.soundcloud.com/tracks/23606164/attachments","sharing_note":{"text":"My new sounds","created_at":"2011/09/18 14:03:59 +0000"}},"tags":"affiliated"}],"next_href":"https://api.soundcloud.com/me/activities/track.json?cursor=86db5e5e-e1fe-11e0-9c69-0f0dad493cfc\\u0026limit=1","future_href":"https://api.soundcloud.com/me/activities/track?uuid%5Bto%5D=2d9c67ee-e22f-11e0-94fa-45aa16adeba3"}

Here is the class structure which i am trying to bind the JSON too

public class Activities
{
    public ActivityTrack [] activities { get; set; }
    public string next_href { get; set; }
    public string future_href { get; set; }
}

public class ActivityTrack
{
    public string type { get; set; }
    public string created_at { get; set; }
    public OriginActivityTrack origin { get; set; }
    public string tags { get; set; }
}

public class OriginActivityTrack
{
    public string id { get; set; }
    public string created_at { get; set; }
    public string user_id { get; set; }
    public string duration { get; set; }
    public string commentable { get; set; }
    public string state { get; set; }
    public string sharing { get; set; }
    public string tag_list { get; set; }
    public string permalink { get; set; }
    public string description { get; set; }
    public string streamable { get; set; }
    public string downloadable { get; set; }
    public string genre { get; set; }
    public string release { get; set; }
    public string purchase_url { get; set; }
    public string label_id { get; set; }
    public string label_name { get; set; }
    public string isrc { get; set; }
    public string video_url { get; set; }
    public string track_type { get; set; }
    public string key_signature { get; set; }
    public string bpm { get; set; }
    public string title { get; set; }
    public string release_year { get; set; }
    public string release_month { get; set; }
    public string release_day { get; set; }
    public string original_format { get; set; }
    public string license { get; set; }
    public string uri { get; set; }
    public string permalink_url { get; set; }
    public string artwork_url { get; set; }
    public string waveform_url { get; set; }
    public SmallUser user { get; set; }
    public string stream_url { get; set; }
    public string user_playback_count { get; set; }
    public string user_favorite { get; set; }
    public string playback_count { get; set; }
    public string download_count { get; set; }
    public string favoritings_count { get; set; }
    public string comment_count { get; set; }
    public string attachments_uri { get; set; }
    public SharingNote sharing_note;
}

public class SharingNote
{
    public string text { get; set; }
    public string created_at { get; set; }
}

public class SmallUser
{
    public string id { get; set; }
    public string permalink { get; set; }
    public string username { get; set; }
    public string uri { get; set; }
    public string permalink_url { get; set; }
    public string avatar_url { get; set; }
}

This is the current code for binding to listbox:

private void ReadCallbackDashboard(IAsyncResult asynchronousResult)
{
    lock (locker)
    {
        try
        {
            HttpWebRequest request =
              (HttpWebRequest)asynchronousResult.AsyncState;
            HttpWebResponse response =
              (HttpWebResponse)request.EndGetResponse(asynchronousResult);
            using (StreamReader streamReader1 =
              new StreamReader(response.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<ActivityTrack>();
                        for (int i = 0; i < obj.activities.Length; ++i)
                        {

                                userDashboardActivities.Add(obj.activities[i]);

                        }

                        if (userDashboardActivities.Count() == 0)
                        {
                            messageDashboard = "No Tracks Found";
                            UIThread.Invoke(() => 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!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T16:36:25+00:00Added an answer on May 25, 2026 at 4:36 pm

    Answer as discovered in the comments.

    You have called your property activities but the json calls it collection.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I'm having trouble keeping the paragraph square between the quote marks. In firefox the
I have just tried to save a simple *.rtf file with some websites and
this is what i have right now Drawing an RSS feed into the php,
I am currently running into a problem where an element is coming back from
We're building an app, our first using Rails 3, and we're having to build
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.