Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

ValidationContext Constructor (Object^, IServiceProvider^, IDictionary<Object^, Object^>^)

 

Initializes a new instance of the ValidationContext class using the service provider and dictionary of service consumers.

Namespace:   System.ComponentModel.DataAnnotations
Assembly:  System.ComponentModel.DataAnnotations (in System.ComponentModel.DataAnnotations.dll)

public:
ValidationContext(
	Object^ instance,
	IServiceProvider^ serviceProvider,
	IDictionary<Object^, Object^>^ items
)

Parameters

instance
Type: System::Object^

The object to validate. This parameter is required.

serviceProvider
Type: System::IServiceProvider^

The object that implements the IServiceProvider interface. This parameter is optional.

items
Type: System.Collections.Generic::IDictionary<Object^, Object^>^

A dictionary of key/value pairs to make available to the service consumers. This parameter is optional.

The serviceProvider parameter represents a service that can be used by the GetService method in order to perform custom validation.

If the items parameter is null, an empty dictionary is created. If the parameter is not null, the set of key/value pairs is copied into a new dictionary, which prevents the service consumers from modifying the original dictionary.

Universal Windows Platform
Available since 10
.NET Framework
Available since 4.0
Silverlight
Available since 3.0
Return to top
Show:
© 2017 Microsoft