INotifyDataErrorInfo Interface

Definition

定义数据实体类可实现以提供自定义同步和异步验证支持的成员。Defines members that data entity classes can implement to provide custom synchronous and asynchronous validation support.

public interface class INotifyDataErrorInfo
public interface INotifyDataErrorInfo
type INotifyDataErrorInfo = interface
Public Interface INotifyDataErrorInfo

Remarks

此接口使数据实体类能够实现自定义验证规则并以异步方式公开验证结果。This interface enables data entity classes to implement custom validation rules and expose validation results asynchronously. 此接口还支持自定义错误对象、每个属性具有多个错误、跨属性错误和实体级别的错误。This interface also supports custom error objects, multiple errors per property, cross-property errors, and entity-level errors. 交叉属性错误是影响多个属性的错误。Cross-property errors are errors that affect multiple properties. 您可以将这些错误与一个或所有受影响的属性关联,也可以将它们视为实体级别的错误。You can associate these errors with one or all of the affected properties, or you can treat them as entity-level errors. 实体级别错误是影响多个属性或影响整个实体而不影响特定属性的错误。Entity-level errors are errors that either affect multiple properties or affect the entire entity without affecting a particular property.

Properties

HasErrors

获取一个值,该值指示实体是否包含验证错误。Gets a value that indicates whether the entity has validation errors.

Methods

GetErrors(String)

获取针对指定属性或整个实体的验证错误。Gets the validation errors for a specified property or for the entire entity.

Events

ErrorsChanged

当验证错误针对属性或整个实体更改时发生。Occurs when the validation errors have changed for a property or for the entire entity.

Applies to