Bearbeiten

Freigeben über


ObservableValidator Constructors

Definition

Overloads

ObservableValidator()

Initializes a new instance of the ObservableValidator class. This constructor will create a new ValidationContext that will be used to validate all properties, which will reference the current instance and no additional services or validation properties and settings.

ObservableValidator(IDictionary<Object,Object>)

Initializes a new instance of the ObservableValidator class. This constructor will create a new ValidationContext that will be used to validate all properties, which will reference the current instance.

ObservableValidator(ValidationContext)

Initializes a new instance of the ObservableValidator class. This constructor will store the input ValidationContext instance, and it will use it to validate all properties for the current viewmodel.

ObservableValidator(IServiceProvider, IDictionary<Object,Object>)

Initializes a new instance of the ObservableValidator class. This constructor will create a new ValidationContext that will be used to validate all properties, which will reference the current instance.

ObservableValidator()

Initializes a new instance of the ObservableValidator class. This constructor will create a new ValidationContext that will be used to validate all properties, which will reference the current instance and no additional services or validation properties and settings.

protected ObservableValidator ();
Protected Sub New ()

Applies to

ObservableValidator(IDictionary<Object,Object>)

Initializes a new instance of the ObservableValidator class. This constructor will create a new ValidationContext that will be used to validate all properties, which will reference the current instance.

protected ObservableValidator (System.Collections.Generic.IDictionary<object,object?>? items);
new Microsoft.Toolkit.Mvvm.ComponentModel.ObservableValidator : System.Collections.Generic.IDictionary<obj, obj> -> Microsoft.Toolkit.Mvvm.ComponentModel.ObservableValidator
Protected Sub New (items As IDictionary(Of Object, Object))

Parameters

items
IDictionary<Object,Object>

A set of key/value pairs to make available to consumers.

Applies to

ObservableValidator(ValidationContext)

Initializes a new instance of the ObservableValidator class. This constructor will store the input ValidationContext instance, and it will use it to validate all properties for the current viewmodel.

protected ObservableValidator (System.ComponentModel.DataAnnotations.ValidationContext validationContext);
new Microsoft.Toolkit.Mvvm.ComponentModel.ObservableValidator : System.ComponentModel.DataAnnotations.ValidationContext -> Microsoft.Toolkit.Mvvm.ComponentModel.ObservableValidator
Protected Sub New (validationContext As ValidationContext)

Parameters

validationContext
ValidationContext

The ValidationContext instance to use to validate properties.

This instance will be passed to all TryValidateObject(Object, ValidationContext, ICollection<ValidationResult>) calls executed by the current viewmodel, and its MemberName property will be updated every time before the call is made to set the name of the property being validated. The property name will not be reset after that, so the value of MemberName will always indicate the name of the last property that was validated, if any.

Applies to

ObservableValidator(IServiceProvider, IDictionary<Object,Object>)

Initializes a new instance of the ObservableValidator class. This constructor will create a new ValidationContext that will be used to validate all properties, which will reference the current instance.

protected ObservableValidator (IServiceProvider? serviceProvider, System.Collections.Generic.IDictionary<object,object?>? items);
new Microsoft.Toolkit.Mvvm.ComponentModel.ObservableValidator : IServiceProvider * System.Collections.Generic.IDictionary<obj, obj> -> Microsoft.Toolkit.Mvvm.ComponentModel.ObservableValidator
Protected Sub New (serviceProvider As IServiceProvider, items As IDictionary(Of Object, Object))

Parameters

serviceProvider
IServiceProvider

An IServiceProvider instance to make available during validation.

items
IDictionary<Object,Object>

A set of key/value pairs to make available to consumers.

Applies to