在类库错误中填充Combobox:'控件'在命名空间'System.Windows'中不存在于WPF项目中

Wel*_*ing 3 c# wpf class

在类库中填充Combobox

我有一个带控件的WPF项目,

我想在我的类库中访问WPF控件并且我得到错误

The type or namespace name 'Controls' does not exist in the namespace 
'System.Windows' 

(are you missing an assembly reference?)
Run Code Online (Sandbox Code Playgroud)

从WPF项目访问函数时不会发生问题当我尝试从类库中执行某些操作时它只会成为一个问题

Dan*_*zey 12

如消息所示,您可能缺少程序集引用.确保您的类库包含对.NET PresentationFramework程序集的引用,您应该没问题.