Condividi tramite


ValidationContext.InitializeServiceProvider Method

Microsoft Silverlight will reach end of support after October 2021. Learn more.

Initializes the ValidationContext with a service provider that can return service instances of the specified type when the GetService method is called.

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

Syntax

'Declaration
Public Sub InitializeServiceProvider ( _
    serviceProvider As Func(Of Type, Object) _
)
public void InitializeServiceProvider(
    Func<Type, Object> serviceProvider
)

Parameters

  • serviceProvider
    Type: System.Func<Type, Object>
    A service provider that can return service instances of the specified type when GetService is called.
    If serviceProvider is nulla null reference (Nothing in Visual Basic), GetService will always return nulla null reference (Nothing in Visual Basic).

Version Information

Silverlight

Supported in: 5

Platforms

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.