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

  • Home
  • SEARCH
  • 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 4608156
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T00:48:18+00:00 2026-05-22T00:48:18+00:00

I am developing a sample Twitter app for Windows phone 7. In my code

  • 0

I am developing a sample Twitter app for Windows phone 7. In my code to display some details of user, used the following code.

    void ShowProfile()
    {
        WebClient client = new WebClient();
        client.DownloadStringCompleted += new DownloadStringCompletedEventHandler(Profile_DownloadCompleted);
        client.DownloadStringAsync(new Uri("http://api.twitter.com/1/users/show.xml?user_id=" + this.id));
    }

    void Profile_DownloadCompleted(object sender, DownloadStringCompletedEventArgs e)
    {
        if (e.Error != null)
        { return; }
        if (e.Result == null) MessageBox.Show("NUlllllllllll");
        XElement Profile = XElement.Parse(e.Result);

    var ProfileDetails = (from profile in Profile.Descendants("user")
                             select  new UserProfile
                             {
                                 UserName = profile.Element("screen_name").Value,
                                 ImageSource = profile.Element("profile_image_url").Value,
                                 Location = profile.Element("location").Value,
                                 TweetsCount = profile.Element("statuses_count").Value,
                             }).FirstOrDefault();

        LayoutRoot.DataContext = ProfileDetails;
 }

Here, LayoutRoot is the Grid name. But the data binding doesn’t work.
Infact, when kept a Break point it seems there is no data in the ProfileDetails object. But I could observe that e.Result contains the required data in the XML format.
Can any body figureout where I am going wrong??
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-22T00:48:19+00:00Added an answer on May 22, 2026 at 12:48 am

    You have used XElement.Parse so Profile represents the single root <user> that API request would have returned. You are then trying to look for user elements inside it which of course makes no sense.

    Try XDocument.Parse instead. Also does it really make any sense assigning a IEnumerable<UserProfile> to the data context when that list can only ever contain 1 entry?

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

Sidebar

Related Questions

Any good source/website/inputs/sample to kickstart developing a twitter application using twitter API? Edit :
I am developing a sample windows application. In this application, I am making use
I am developing an in app billing application for Android In this sample ,
I'm developing a .NET class library, along with some sample sources. So, My solutions
I'm developing an application which has a Settings pane, following the AppPrefs sample by
I'm developing an application with the help of sample code from the WWDC 2010
I'm developing a sample app for android and my level is beginner. For simplicity
I'm developing a simple Qt 4 app and making my own dialog. I subclassed
I begun developing my own SIMPLE twitter client in my server (to bypass twitter.com
I'm developing an image viewer, much like the Photos App. It's a UIScrollView with

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.