views:

114

answers:

1

I'm doing an experiment on WPF and MVVM, and while coding the ViewModel on Vb.net I noticed this red wavy lines under my ObservableCollection(of T)s T_T

Anyway, the application is in WPF & VB.Net, under the .Net Framework 3.5 (I checked) and I have an 'Imports System.Collections.ObjectModel' on top of my class. Intellisense shows the other classes on System.Collections.ObjectModel except ObservableCollection.

Here's a screenshot.

So, why is ObservableCollection(of T) missing and how do I make it appear? :( Thanks in advance.

+2  A: 

You need to add a reference to WindowsBase. Some elements in System.Collections live in mscorlib, but the WPF specific things like ObservableCollection live in WindowsBase.dll

Confusing I know :-)

Steven Robbins
^^ Yey~! Thanks!
GaiusSensei
Just wanted to point out that in .Net 4, ObservableCollection's been moved to System.dll
rossisdead