• 博客园logo
  • 会员
  • 周边
  • 新闻
  • 博问
  • 闪存
  • 众包
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
金大鑫要坚持
博客园    首页    新随笔    联系   管理    订阅  订阅

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

 

posted @ 2016-12-06 10:07  金大鑫要坚持  阅读(16113)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3