Edit

Share via


TypeExtension.ProvideValue(IServiceProvider) Method

Definition

Returns an object that should be set on the property where this extension is applied. For TypeExtension , this is the Type value as evaluated for the requested type name.

public:
 override System::Object ^ ProvideValue(IServiceProvider ^ serviceProvider);
public override object ProvideValue (IServiceProvider serviceProvider);
override this.ProvideValue : IServiceProvider -> obj
Public Overrides Function ProvideValue (serviceProvider As IServiceProvider) As Object

Parameters

serviceProvider
IServiceProvider

Object that can provide services for the markup extension. The provider is expected to provide a service for IXamlTypeResolver.

Returns

The Type to set on the property where the extension is applied.

Exceptions

member value for the extension is null.

Some part of the typeName string did not parse properly.

-or-

serviceProvider did not provide a service for IXamlTypeResolver

-or-

typeName value did not resolve to a type.

serviceProvider is null

Remarks

You can pass null for serviceProvider, but only if this TypeExtension instance was established with an initial true type in the constructor rather than a typeName. Otherwise, this markup extension implementation relies on services based on the passed serviceProvider. It must not be null. The serviceProvider is expected to provide a service for IXamlTypeResolver.

Applies to