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.
我刚刚开始了解 WPF、MVVM 和 Prism 6。我了解如何使用 IDataErrorInfo,但我不知道为什么或如何使用 IDataErrorInfo.Error。在我见过的每个示例中,它的 get 方法都返回 null 或未实现的异常。它必须在类中,否则会出现编译错误。
它是干什么用的?
根据我的经验,我可以告诉你这个字段非常有用 - 它基本上用于向用户提供有关错误的工具提示。
例如,看看这里