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 8607813
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T03:27:14+00:00 2026-06-12T03:27:14+00:00

I used http://json2csharp.com to generate the C# class from the below JSON string. {

  • 0

I used http://json2csharp.com to generate the C# class from the below JSON string.

{
    "stationArr":[
        {
            "id":"9",
            "name":"name9",
        "sidebar":{
                "original":"http://myurl.com/station_images/5/5_s.png",
                "m":"http://myurl.com/station_images/5/m/5_s_m.png",
                "s":"http://myurl.com/station_images/5/s/5_s_s.png"
            }
        },
    {
            "id":"3",
            "name":"name3",
        "sidebar":{
                "original":"http://myurl.com/station_images/5/5_s.png",
                "m":"http://myurl.com/station_images/5/m/5_s_m.png",
                "s":"http://myurl.com/station_images/5/s/5_s_s.png"
            }
    ]
    "stationUrlMap":{
        "9":"http://myurl.com/9_64",
        "3":"http://myurl.com/3_64",
    }
}

The generated classes are (I created different .cs for each class.

public class Sidebar
{
    public string original { get; set; }
    public string m { get; set; }
    public string s { get; set; }
}

public class StationArr
{
    public string id { get; set; }
    public string name { get; set; }
    public Sidebar sidebar { get; set; }
}

/*public class StationUrlMap
{
    public string __invalid_name__9 { get; set; }
    public string __invalid_name__3 { get; set; }
}
*/
public class StationList
{
    public List<StationArr> stationArr { get; set; }
//    public StationUrlMap stationUrlMap { get; set; } Dicarded it
}

I have discarded the StationUrlMap as I don’t need it.

I am using the following code to create the Object

string resultString = sd.ReadToEnd();
StationList stations = JsonConvert.DeserializeObject<StationList>(resultString);
Debug.Writeline(stations.stationArr.Count); // gives Output 9 Which is correct.

I just don’t know how to display the List of stations in the UI (using ListBox). Please guide me in the right direction.

  • 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-06-12T03:27:16+00:00Added an answer on June 12, 2026 at 3:27 am

    Create a ListBox in the XAML

    <ListBox x:Name="ListBoxStations" Height="500" >
        <ListBox.ItemTemplate>
            <DataTemplate>
                <StackPanel Orientation="Horizontal" Width="450">
                     <Image Source="{Binding Path=sidebar.original}"/>
                     <TextBlock Text="{Binding Path=name}"/>
                </StackPanel>
            </DataTemplate>
        </ListBox.ItemTemplate>
    </ListBox>
    

    And then in your cs file, after the json conversion do the following

    StationList stations = JsonConvert.DeserializeObject<StationList>(resultString);
    ListBoxStations.ItemsSource = stations.stationArr;
    

    The above XAML code is just a sample, change based on your requirements.

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

Sidebar

Related Questions

I used the code from http://www.rgagnon.com/javadetails/java-0580.html to get Motherboard Id, but the result is
I used SSIS and [SharePointListAdapters][1] [1]: http://sqlsrvintegrationsrv.codeplex.com/releases to import data from my SharePoint 2010
So I have used - http://www.roundedcornr.com/ - to generate some rounded corners via CSS.
I've previously used http://code.google.com/p/wkhtmltopdf/ with http://pypi.python.org/pypi/wkhtmltopdf/0.2 to create screenshots of websites from the command
I am reading the price information from the http://aws.amazon.com/ec2/pricing/pricing-ebs-optimized-instances.json following is the code example
where used on http://localhost:8692/Contacts/Default.aspx Response.Redirect( http://www.google.com ) redirects to http://localhost:8692/Contacts/http%3a%2f%2fwww.google.com The problem just appeared
I've used Widerbug ( http://www.command-tab.com/2008/01/19/widerbug-widescreen-firebug/ ) to open Firebug in the right side of
I used this example (http://reecon.wordpress.com/2010/04/25/uploading-files-to-http-server-using-post-android-sdk/) to upload file from android device to server, it
I have used http://readysetraphael.com/ to convert a svg to a path in raphaeljs. I
Anyone used http://github.com/manifestinteractive/jqvmap/ ? These work: $('#map').vectorMap('set', 'colors', { us: '#8EE5EE' }); $('#map').vectorMap('set', 'colors',

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.