命名空间’System.Windows’中不存在类型或命名空间名称’Window’

我正在尝试为WPF Window类编写扩展方法。 我在我的解决方案中的类库项目中这样做,以便我可以在解决方案中的所有项目中使用它。

这是我的代码:

using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using System.Windows; namespace ExtensionMethods { public static class MyExtensions { public static void ResizeToPrimaryScreenWorkingArea(this System.Windows.Window w) { } } } 

当我尝试编译它时,我收到以下错误:

命名空间’System.Windows’中不存在类型或命名空间名称’Window’

是的,我在我的类库项目中添加了对System.Windows和System.Windows.Forms的引用,它们显示在解决方案资源管理器中项目的引用下。

我究竟做错了什么?

PresentationFramework.dll引用添加到包含System.Windows命名空间的项目中。

http://msdn.microsoft.com/es-es/library/system.windows.window(v=vs.110).aspx