1

I have a C# collection class and I want it to be notified when one of it's collection items changes. This is so I can then update all of the items in that collection. What would be the best way of doing that?

I'm using an ObservableCollection because I'm binding the collection to a WPF ListBox.

This is my collection class:

public class Shows : ObservableCollection<ShowDetails>
{
  ...
}

and each item class is:

public class Show : INotifyPropertyChanged
{
  ...
}
Surfbutler
  • 1,529
  • 2
  • 17
  • 38

1 Answers1

0

I ended up passing down a reference to the collection into each item on creation. Then when I wanted to notify the collection I just called a public function in that collection, which then updated all the sibling items.

Thanks anyway.

Surfbutler
  • 1,529
  • 2
  • 17
  • 38