C# 如何在 WPF 4.5 中实现 INotifyDataErrorInfo?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/9950128/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-09 11:21:11  来源:igfitidea点击:

How to implement INotifyDataErrorInfo in WPF 4.5?

c#wpfsilverlightinotifydataerrorinfo

提问by Darf Zon

I realized that appears this interface in .NET Framework 4.5

我意识到在 .NET Framework 4.5 中出现了这个界面

I was looking first for about how to implemented in Silverlight (I can imagine that it's implemented in the same way), but I can't find a compact demo of this new interface. Is it possible to show how can I use it?

我首先在寻找如何在 Silverlight 中实现(我可以想象它是以相同的方式实现的),但是我找不到这个新界面的紧凑演示。是否可以展示我如何使用它?

I really want to find a small demo to understand it

真想找个小demo了解一下

采纳答案by nemesv

Beside the very detailed description on MSDN about the Silverlight version of INotifyDataErrorInfo

除了MSDN上关于INotifyDataErrorInfoSilverlight版本的非常详细的描述

There are already some blog posts with samples how to use/implement it in WPF 4.5:

已经有一些博客文章包含如何在 WPF 4.5 中使用/实现它的示例:

回答by Julien

The PRISM libraryhas a very good example implementation in the MVVM RI sample, the class named DomainObjectimplements both INotifyPropertyChanged and INotifyDataErrorInfo.

PRISM库有MVVM RI样品中一个很好的例子实施,命名类domainObject的同时实现了INotifyPropertyChanged的和INotifyDataErrorInfo。

It is a SL version but it now compiles with .NET 4.5

它是一个 SL 版本,但现在可以使用 .NET 4.5 进行编译