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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T14:57:22+00:00 2026-05-22T14:57:22+00:00

I am developing silverlight 4 application. I am using the following listbox for dynamic

  • 0

I am developing silverlight 4 application. I am using the following listbox for dynamic binding

<ListBox Margin="44,100,46,138" x:Name="lstbox1">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel Orientation="Vertical">
                        <TextBlock Text="{Binding A1}" Foreground="Gray" FontSize="14" Width="100" Height="20" ></TextBlock>
                        <TextBlock Text="{Binding A2}" Foreground="Red" Width="100" Height="20" ></TextBlock>
                        <Line X1="-3400" Y1="32" X2="10" Y2="32" Stroke="Gray" StrokeThickness="1"/>
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>

I am using the following code in code behind

List<Data1> ObserCollObj = new List<Data1>();
        public MainPage()
        {
            InitializeComponent();
            Data1 obj1 = new Data1("aaa", "dasd");
            ObserCollObj.Add(obj1);
            lstbox1.ItemsSource = ObserCollObj;

        }

I am using the following class

class Data1
    {
        public String A1 { get; set;}
        public String A2 { get; set; }
        public Data1()
        {
        }
        public Data1(String a1, String a2)
        {
            A1 = a1;
            A2 = a2;
        }
    }

I am using all above code but the dynamic binding does not working.Is anything wrong in my xaml or code behind ? Can you please tell me where I am going wrong ? Can you please provide me any solution through which I can resolve the above issue?

  • 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-22T14:57:23+00:00Added an answer on May 22, 2026 at 2:57 pm

    The initial problem is that the Data1 class needs to be public (currently its internal).

    However if you really want dynamic binding then you probably mean that you want to be able to add new entries on the list and for them to appear in the UI.

    You should therefore use a ObservableCollection<Data1> instead of a simple List<Data1>.

    You may also want to be able to modify the properties of individual entries and have those changes reflected in the UI, to do that you need to implement INotifyPropertyChanged on your Data1 class.

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

Sidebar

Related Questions

I'm developing a web page for a customer using the Silverlight application for dynamic
I am developing a silverlight 3 application using WCF RIA services. I am using
We are developing an Silverlight with Wcf business application. We are using Wcf DataContract
At the moment I'm developing a web based application using Silverlight 3.0. For the
I'm developing a small web application using Microsoft Silverlight 3. I'm using Microsoft Expressin
I am developing a RIA using Silverlight its completely Database Driven Application but I
I'm developing a Silverlight application that displays items in a listbox control and I've
I am developing silverlight application. I have a listbox in my application. I am
I have been developing a Silverlight application using WCF. The problem is that sometimes
I'm developing a Silverlight Business Application, using a RIA service, which is returning POCO

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.