即使使用’System.Collections.ObjectModel’也找不到’ObservableCollection’
包含System.Collections.ObjectModel
。 Visual Studio 2012仍然说Type or namespace name 'ObservableCollection' could not be found.
与此问题类似
码:
class ObservableClass : ObservableCollection { }
编辑:这是.NET Framework 3.5,是一个控制台应用程序
您可能缺少程序集引用…根据您要定位的框架,可能会找到此类:
- 在WindowsBase.dll(.NET 3.x)中
- 在System.dll(.NET 4.x)中
- 在System.Windows.dll(Silverlight / Windows Phone 7)中
- 在System.ObjectModel.dll(WinRT)中(包含在“.NET for Windows Store应用程序”中)