【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. 大功告成啦~

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM