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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T21:34:07+00:00 2026-06-04T21:34:07+00:00

Hello I have problem with binding data to Listbox. In shortway… I want list

  • 0

Hello I have problem with binding data to Listbox. In shortway… I want list all my Skydrive files.

My XAML

 <TextBlock Height="35" HorizontalAlignment="Left" Margin="9,6,0,0" Name="infoTextBlock" Text="" VerticalAlignment="Top" Width="Auto" />
            <my:SignInButton Name="signInButton1" ClientId="<correct ClientId>" Scopes="wl.signin wl.basic wl.skydrive" Branding="Windows" TextType="SignIn" SessionChanged="signInButton1_SessionChanged" HorizontalAlignment="Left"  VerticalAlignment="Top" Margin="198,-6,0,0" />
            <StackPanel Height="578" HorizontalAlignment="Left" Margin="10,50,0,0" Name="StackContentPanel" VerticalAlignment="Top" Width="440">
                <ListBox Height="465" Name="FileList" Width="380" ItemsSource="{Binding Files}">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <TextBlock Text="{Binding Name}"/>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>
            </StackPanel>

My class and cs.

    namespace EReader.ViewModel
    {
        public class File
        {
            public File()
            {}

            private string name;
            public string Name
            {
                get { return this.name; }
                set { this.name = value; }
            }

        }
    }

    public class FilesManager
    {
        public ObservableCollection<string> Files;

        public FilesManager()
        {
            Files = new ObservableCollection<string>();
        }

    }


namespace EReader
{
    public partial class MainPage : PhoneApplicationPage
    {
        private LiveConnectClient client;
        // Constructor
        public MainPage()
        {
            InitializeComponent();
        }

        private void signInButton1_SessionChanged(object sender, LiveConnectSessionChangedEventArgs e)
        {

            if (e.Status == LiveConnectSessionStatus.Connected)
            {


                client = new LiveConnectClient(e.Session);
                infoTextBlock.Text = "Signed in.";
                client.GetCompleted +=
                    new EventHandler<LiveOperationCompletedEventArgs>(OnGetCompleted);
                client.GetAsync("/me/skydrive/files/");
            }
            else
            {
                infoTextBlock.Text = "Not signed in.";
                client = null;
            }
        }

        void OnGetCompleted(object sender, LiveOperationCompletedEventArgs e)
        {
            //Gdy uda nam się podłaczyc do konta skydrive
            if (e.Error == null)
            {
                signInButton1.Visibility = System.Windows.Visibility.Collapsed;

                #region Nazwa użytkownika
                string firstName = "";
                string lastName = "";
                if (e.Result.ContainsKey("first_name") ||
                    e.Result.ContainsKey("last_name"))
                {
                    if (e.Result.ContainsKey("first_name"))
                    {
                        if (e.Result["first_name"] != null)
                        {
                            firstName = e.Result["first_name"].ToString();
                        }
                    }
                    if (e.Result.ContainsKey("last_name"))
                    {
                        if (e.Result["last_name"] != null)
                        {
                            lastName = e.Result["last_name"].ToString();
                        }
                    }
                    infoTextBlock.Text =
                        "Hello, " + firstName +" "+ lastName + "!";
                }
                else
                {
                    infoTextBlock.Text = "Hello, signed-in user!";
                }
                #endregion

                #region Wszyskite pliki

                List<object> data = (List<object>)e.Result["data"];

                FilesManager fileManager = new FilesManager();

                foreach (IDictionary<string,object> items in data)
                {
                    File file = new File();

                    file.Name= items["name"].ToString();

                    fileManager.Files.Add(file.Name);
                }

                FileList.ItemsSource = fileManager.Files;
                #endregion
            }
            else
            {
                infoTextBlock.Text = "Error calling API: " +
                    e.Error.ToString();
            }
        }


    }
  • 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-04T21:34:08+00:00Added an answer on June 4, 2026 at 9:34 pm

    Files must be a property, not a field.

    Furthermore {Binding Name} must be {Binding} instead, because a string has no Name property.

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

Sidebar

Related Questions

Hello I have a problem with a binding that I want to do and
Hello i have problem with my sms aplication. import java.util.ArrayList; import java.util.List; import android.app.Activity;
Hello I have a problem I have Column data in string format in this
Hello I have problem to put together animations of two separate objects to second
Hello i have the following problem. I have a search page lets call it
Hello i have the following problem, I record a video using red5 like this:
Hello everyone i have a problem I have a text $text = some and
Hello everybody I have a problem with exception. The following code block do this
Hello I have a very weird problem in chrome I just cannot figure out!
I have this problem when trying to run hello world program using android SDK.

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.