Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

I can't add reference to namespace system.windows.controls in a library project

I'm trying to add a reference to the namespace System.Windows.Controls in a library project but i can't find it in the list. Does anybody know what is going on? i'm using 4.0. thanks.

like image 342
Ziad Avatar asked Aug 19 '11 06:08

Ziad


1 Answers

You need to learn to distinguish between assembly names and namespaces. They're not in a 1-1 correspondence.

If you're wanting to access e.g. System.Windows.Controls.Button, you need to reference the PresentationFramework assembly, which does seem to contain most of the classes documented on MSDN as being in the System.Windows.Controls namespace.

Multiple assemblies can contribute classes/controls to a single namespace. And there's no requirement that all (or even the majority) of classes from an assembly all reside within a single namespace.

like image 92
Damien_The_Unbeliever Avatar answered Sep 21 '22 02:09

Damien_The_Unbeliever