【C# 小窍门】WeakEventManager 无法识别!ErrorCS0246The type or namespace name 'WeakEventManager' could not be found

WeakEventManager

想用一下这个,在学习C# 事件的时候,结果添加了Using System.Windows, WeakEventManager却一直是红色的,无法识别,报这个错哦~

好不容易想用个高大上的弱事件,还找不到命名空间!解决啦!

stackoverflow上找到的答案哦~ 并非原创~ 马克给墙内的小白看~

Severity Code Description Project File Line Suppression State
Error CS0246 The type or namespace name 'WeakEventManager' could not be found (are you missing a using directive or an assembly reference?) CarSale

用的是VS 2015

如何解决?

1. 点add reference~

 2. Add reference : WindowBase

3. 大功告成啦~

原文地址:https://www.cnblogs.com/jin-wen-xin/p/6136452.html