silverlight-4.0 – INotifyDataErrorInfo.GetErrors应返回什么类型的IEnumerable?

silverlight-4.0 – INotifyDataErrorInfo.GetErrors应返回什么类型的IEnumerable?,第1张

概述我想到MSDN上的官方文档没有说明由INotifyDataErrorInfo的GetErrors返回的可枚举的基础对象类型应该是什么: http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifydataerrorinfo.geterrors(v=vs.95).aspx 选项包括:System.String,System 我想到MSDN上的官方文档没有说明由INotifyDataErrorInfo的GetErrors返回的可枚举的基础对象类型应该是什么: http://msdn.microsoft.com/en-us/library/system.componentmodel.inotifydataerrorinfo.geterrors(v=vs.95).aspx

选项包括:System.String,System.Object,MyCustomObject,ISomeOtherShitThatDoesntHaveAnythingTodoWithValIDationWhatever

任何人都可以向我解释一个任意的可枚举对象如何在不对其结构做出任何假设的情况下通知错误吗?

解决方法 docs for INotifyDataErrorInfo提供了更多信息:

The valIDation errors returned by the GetErrors method can be of any type. However,if you implement a custom error type,be sure to overrIDe the ToString method to return an error message. Silverlight uses this string in its default error reporting.

Custom error objects are useful when you provIDe custom error reporting in the user interface. For example,you can create a template for the reporting tooltip that binds to an ErrorLevel property in order to display warnings in yellow and critical errors in red.

GetErrors的Examples部分中有一个链接回到该文档:

For an example of an implementation of this method,see the INotifyDataErrorInfo class overvIEw.

我同意它不太清楚,但文件是……

总结

以上是内存溢出为你收集整理的silverlight-4.0 – INotifyDataErrorInfo.GetErrors应返回什么类型的IEnumerable?全部内容,希望文章能够帮你解决silverlight-4.0 – INotifyDataErrorInfo.GetErrors应返回什么类型的IEnumerable?所遇到的程序开发问题。

如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。

欢迎分享,转载请注明来源:内存溢出

原文地址:https://www.54852.com/web/1209361.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-06-04
下一篇2022-06-04

发表评论

登录后才能评论

评论列表(0条)

    保存