Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

System.Windows.Data is missing from my list of .NET libraries

Tags:

.net

Hi I'd like to use System.Windows.Data.IValueConverter, but when I try to add a reference to System.Windows.Data in VS2010, I only see System.Windows.Forms and System.Windows.Presentation. What am I missing? I'm using .NET 3.5 (not the client version), and I think the library should exist for that version. Switching my project to .NET 4.0 didn't help. Googling didn't turn up any people experiencing this problem. TIA.

like image 366
Carl G Avatar asked Aug 21 '10 20:08

Carl G


2 Answers

Although IValueConverter is in the System.Windows.Data namespace, it's in the PresentationFramework assembly. It's worth being aware of the difference between the two concepts. An assembly is the unit of deployment in .NET, but a single assembly can have types in multiple namespaces, and multiple assemblies can contribute types to the same namespace.

In practical terms, assemblies are what you add references to at the project level, and namespaces are what you have using directives for at the top of your source file :)

When you're not sure where a type is, in terms of either its namespace or its assembly, consult MSDN (such as the link above) which specifies both, like this:

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

like image 161
Jon Skeet Avatar answered Sep 17 '22 02:09

Jon Skeet


System.Windows.Data namespace comes from PresentationFramework.dll . Have you included it in your application (add new reference and so on)?

like image 42
tchrikch Avatar answered Sep 19 '22 02:09

tchrikch