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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T19:24:21+00:00 2026-05-24T19:24:21+00:00

From the MSDN about OnCollectionChanged: Occurs when an item is added, removed, changed, moved,

  • 0

From the MSDN about OnCollectionChanged: “Occurs when an item is added, removed, changed, moved, or the entire list is refreshed.”

I’m changing a property attached to an obj that resides in my collection, but OnCollectionChanged isn’t fired. I am implementing iNotifyPropertyChanged on the obj class.

public class ObservableBatchCollection : ObservableCollection<BatchData>
    {
        protected override void OnCollectionChanged(System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
        {
            if(e.Action == System.Collections.Specialized.NotifyCollectionChangedAction.Add)
            {
                foreach (BatchData item in e.NewItems)
                {

                }
            }
            base.OnCollectionChanged(e);
        }

        public ObservableBatchCollection(IEnumerable<BatchData> items)
            : base(items)
        {

        }
}

To me, that reads that when an item in the collection is changed, such as a property of the object, that this event should fire. It’s not, however. I want to be able to know when an item in my custom collection changes so I can perform a calculation on it, if needed.

Any thoughts?

  • 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-24T19:24:22+00:00Added an answer on May 24, 2026 at 7:24 pm

    ObservableCollection<T> raises events only when the collection itself changes. An item contained in the collection that has its internal state mutated has not altered the structure of the collection, and ObservableCollection<T> will not report it.

    One option is to subclass ObservableCollection<T> and subscribe to each item’s OnPropertyChanged event when it is added. In that handler, you can raise either a custom event, or fall back to the collection’s own PropertyChanged event. Note that if you do go this route, you should add a generic constraint so that T : INotifyPropertyChanged.

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

Sidebar

Related Questions

From MSDN about the differences between Adding or Inserting an item the ASP.NET Cache:
I've been following this guide from MSDN about Creating an ASP.NET MVC Areas Application
I am reading SQL Server lock escalation from MSDN Page about SQL Server lock
When reading the tutorial of Properties Tutorial from MSDN. I'm consused about the example.
I have some misunderstanding about the gslice function. Definition from MSDN states: gslice defines
From MSDN: The CancelWaitableTimer function does not change the signaled state of the timer.
I understand the main function of the lock key word from MSDN lock Statement
Where can I find the IIS object schema? All I found from MSDN was
Change Data Capture is a new feature in SQL Server 2008. From MSDN: Change
From the MSDN article on STAThread: Indicates that the COM threading model for an

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.