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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T23:21:29+00:00 2026-05-19T23:21:29+00:00

i found a piece of code that use ObservableCollection but they can use list

  • 0

i found a piece of code that use ObservableCollection but they can use list or any other collection related classes. can anyone tell me what is the benifit of using ObservableCollection.

ObservableCollection<Employee> empData = new ObservableCollection<Employee> 
        {
            new Employee{Name="Diptimaya Patra", Contact="0000", 
                EmailID="diptimaya.patra@some.com", Country="India"},
            new Employee{Name="Dhananjay Kumar", Contact="00020", 
                EmailID="dhananjay.kumar@some.com", Country="India"},
            new Employee{Name="David Paul", Contact="1230", 
                EmailID="david.paul@some.com", Country="India"},
            new Employee{Name="Christina Joy", Contact="1980", 
                EmailID="christina.joy@some.com", Country="UK"},
            new Employee{Name="Hiro Nakamura", Contact="0000", 
                EmailID="hiro.nakamura@some.com", Country="Japan"},
            new Employee{Name="Angela Patrelli", Contact="0000", 
                EmailID="angela.patrelli@some.com", Country="Japan"},
            new Employee{Name="Zoran White", Contact="0000", 
                EmailID="diptimaya.patra@some.com", Country="Scotland"},
        };

please discuss in detail. thanks

  • 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-19T23:21:29+00:00Added an answer on May 19, 2026 at 11:21 pm

    ObservableCollection implements INotifyPropertyChanged. This interface exposes events that allow consumers of your collection to be notified when the contents of the collection change.

    This is mainly used when binding in WPF, for example let’s say we have an ObservableCollection<string>:

    ObservableCollection<string> MyStrings
    {
        get
        {
            // return a collection with some strings here
        }
    }
    

    and this control in XAML:

    <ComboBox ItemsSource="{Binding MyStrings}" />
    

    The ComboBox will show the strings inside your ObservableCollection. So far, this would have worked just fine with a List<string> as well. However, if you now add some strings to the collection, for example:

    <Button Click="AddSomeStrings" Content="Click me!" />
    
    private void AddSomeStrings(object sender, RoutedEventArgs e)
    {
        this.MyStrings.Add("Additional string!");
    }
    

    you will see that the contents of the ComboBox will be immediately updated and the string will be added to the list of options. This is all accomplished using INotifyCollectionChanged.

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

Sidebar

Related Questions

I recently found myself writing a piece of code that executed a Core Data
Found a piece of code today, that I find a little smelly... TMyObject.LoadFromFile(const filename:
Basically my problem is that i've adapted a piece of code found here http://social.msdn.microsoft.com/Forums/en-US/vemapcontroldev/thread/62e70670-f306-4bb7-8684-549979af91c1
I've been here and accordingly found out that this piece of code here var
I use this piece of code (found on stackoverflow) to generate an OrderBy static
I have a simple piece of code that i want to use in my
I have a piece of code that I use to provide an implicit ordering
I found this piece of Java code at Wikipedia that is supposed to shuffle
I'm running AQTime on this piece of code, I found that .IndexOf takes 16%
I found this piece of code and I'd like to understand why the developer

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.