Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Implement IValueConverter in class library project

I have a solution with about 12 projects, one is set as the startup project and this contains the main window. At the moment all of my IValueConverters are inside this project.

I now want to move them into a separate project that will hold only converters. This way I will be able to reuse them across all the projects, not just the main window.

  • I have created a new project (class library)
  • I have imported WindowsBase
  • I have Included a reference to System.Windows.Data
  • I am using Visual Studio 2010 Express with .NET 4

I get the error:

"Error 3 The type or namespace name 'IValueConverter' could not be found (are you missing a using directive or an assembly reference?) "

like image 426
Drahcir Avatar asked Dec 13 '12 13:12

Drahcir


2 Answers

You need to add a reference to PresentationFramework.dll, that's where IValueConverter is actually defined.

Looking at the documentation you can find that information at the top:

Namespace: System.Windows.Data
Assembly: PresentationFramework (in PresentationFramework.dll)

like image 196
Daniel Hilgarth Avatar answered Oct 18 '22 23:10

Daniel Hilgarth


Please have a look here. I'm sure you're missing the library PresentationFramework.dll in your project.

like image 44
DHN Avatar answered Oct 19 '22 00:10

DHN