0

I'm trying to use MS' ObservableConcurrentDictionary sample, but I ran into a completely unexpected problem.

INotifyCollectionChanged interface is NOT found in System.Collections.Specialized namespace. The project is WinForms, and I tried targeting .NET 3.5 and 3.5 Client Profile to no avail, despite MSDN saying it's supported. There is nothing found in the assemblies that has Colections in it, so I suppose I'm not missing any references either. Google search was inconclusive, apparently I'm the only one in the whole wide world to have such a problem.

Just what the hell is wrong with this thing?

Here is a screenshot. Note how System.Collections.Specialized is marked as unused.

Screenshot of VS interface. Note how System.Collections.Specialized is marked as unused.

Vindicar
  • 354
  • 2
  • 9

1 Answers1

2

In .NET 3.5, INotifyCollectionChanged was compiled as part of WindowsBase.dll. Only in .NET 4.0 was it moved to the core System.dll. You'll have to add a reference to WindowsBase to access it.

However, I'm not aware of the INotifyPropertyChanged/INotifyCollectionChanged being relevant for WinForms - they're a core part of the WPF MVVM Binding experience. Are you sure they're the tool you want to use?

Avner Shahar-Kashtan
  • 14,492
  • 3
  • 37
  • 63
  • Wow. I would never thought to look there of all places... As for that, I want an observable dictionary, and all implementations I saw are using that interface. – Vindicar Dec 10 '15 at 07:02