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've found this piece of code on Koders : private ServiceProvider SiteServiceProvider { get
after a bit speedtracing I found a piece of code (called very very often)
I was reading a book on templates and found the following piece of code:
I found this open-source library that I want to use in my Java application.
('1' * N) !~ /^1?$|^(11+?)\1+$/ On the net, I found this piece of Ruby
Found some old code, circa VS 2003. Now I have just VS 2008 (SP1)
Found the following in an Oracle-based application that we're migrating (generalized) : SELECT Table1.Category1,
I found What are mvp and mvc and what is the difference but it
I have found this example on StackOverflow: var people = new List<Person> { new
I found a bug in the Contains statement in Linq (not sure if it

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.