0

I have a Class in my main WPF application which has a Property defined in the class as follows:

Public Class AppExample
    Public PropertyName As CollectionViewSource

The project solution also inherits a Class Library (separate project but included in the solution and using the Inherits statement) - in the Class Library I want to do the same thing but I get an error.

Public Class ClassLibraryExample
    Public PropertyName as CollectionViewSource

this results in:

Type 'CollectionViewSource' is not defined

How do I fix this?

Ben
  • 1,000
  • 2
  • 15
  • 36
  • did you include `System.Windows.Data` namespace in your ClassLibraryExample? – Nitin Oct 04 '13 at 08:52
  • I can only seem to add System.Windows.Input and System.Windows.Markup in the Class Library. Can't seem to add System.Windows.Data – Ben Oct 04 '13 at 08:59
  • aha! I had to add a reference to PresentationFramework. @nit, please add as the answer so I can mark it do you. thanks. – Ben Oct 04 '13 at 09:03

2 Answers2

0

Add the refernce of PresentationFramework.dll to your class library. It has namespace System.Windows.Data which contains CollectionViewSource

Nitin
  • 18,344
  • 2
  • 36
  • 53
0

When you are using CollectionViewSource you have to use Data namespace(System.Windows.Data).

J R B
  • 2,069
  • 4
  • 17
  • 32