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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T08:43:33+00:00 2026-06-14T08:43:33+00:00

I have an ObservableCollection<CustomClass> . The CustomClass has a few properties. One of them

  • 0

I have an ObservableCollection<CustomClass>. The CustomClass has a few properties. One of them is called Name and of type string. The whole thing is bound to a WPF datagrid. Now I need to get notified when the Name of any member of the collection is changed. The CollectionChanged event of the collection is not fired. I could implement INotifyPropertyChanged but where do I listen to it?

  • 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-14T08:43:35+00:00Added an answer on June 14, 2026 at 8:43 am

    Initial answer

    You indeed need to implement INotifyPropertyChanged on your custom class, and you need to subscribe to the PropertyChanged event of ALL objects in the collection. If a property is updated, you’ll get notified of the change of that single object.

    Update

    If you want to see what the old and the new values are, then you need to create your own PropertyChanged event (maybe name it PropertyUpdated to prevent confusion which is which).
    Something like below. If you implement this event (like the custom class shows), and use this event instead of INotifyPropertyChanged, then you have access to the old and new value of the updated property in the event arguments when you’re handling the event.

    public class PropertyUpdatedEventArgs: PropertyChangedEventArgs {
        public PropertyUpdatedEventArgs(string propertyName, object oldValue, object newValue): base(propertyName) {
            OldValue = oldValue;
            NewValue = newValue;
        }
    
        public object OldValue { get; private set; }
        public object NewValue { get; private set; }
    }
    
    public interface INotifyPropertyUpdated {
        event EventHandler<PropertyUpdatedEventArgs> PropertyUpdated;
    }
    
    public MyCustomClass: INotifyPropertyUpdated {
        #region INotifyPropertyUpdated members
    
        public event EventHandler<PropertyUpdatedEventArgs> PropertyUpdated;
    
        private void OnPropertyUpdated (string propertyName, object oldValue, object newValue) {
            var propertyUpdated = PropertyUpdated;
            if (propertyUpdated != null) {
                propertyUpdated(this, new PropertyUpdatedEventArgs(propertyName, oldValue, newValue));
            }
        }
    
        #endregion
        #region Properties
    
        private int _someValue;
        public int SomeValue {
            get { return _someValue; }
            set {
                if (_someValue != value) {
                    var oldValue = _someValue;
                    _someValue = value;
                    OnPropertyUpdated("SomeValue", oldValue, SomeValue);
                }
            }
        }
    
        #endregion  
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an ObservableCollection of Task objects. Each Task has the following properties: AssignedTo
I have an ObservableCollection<Object1> type( Messages in code below) which is bound to an
I have a ObservableCollection of Patient objects. Each Patient object has a Name property,
I have an ObservableCollection<T> . T has a ToString() method. What I'd like to
I have an instance of ObservableCollection bound to a WPF listbox with two separate
Setup: I have a combo-box, it's itemsource bound to an ObservableCollection<T> of a custom
I have ObservableCollection<ViewUnit> _myItems field, where ViewUnit implements INotifyPropertyChanged . ViewUnit has Handled :
I have a ObservableCollection which holds records of custom type Item. I use that
I have an ObservableCollection bound to a WPFToolkit DataGrid in an MVVM pattern. Every
I have a ObservableCollection<Class1> where Class1 contains x and y positions as properties. The

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.