Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
它认为可以注销 aDelegateCommand但如何?谷歌搜索时我没有找到任何有用的例子。
DelegateCommand
我的第二个问题是可以检索应用程序使用的事件/委托命令的完整列表吗?
问候
通过以下方式取消注册-=:
-=
myEvent += (MyDelegateHandler)myDelegateFunction;
并注销:
myEvent -= (MyDelegateHandler)myDelegateFunction;
您可以通过 GetInvocationList 枚举所有代表
foreach(Delegate d in myEvent.GetInvocationList()) { myEvent -= (MyDelegateHandler)d; }