TypeExtension.ProvideValue Method (IServiceProvider)


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.

Namespace:   System.Windows.Markup
Assembly:  System.Xaml (in System.Xaml.dll)

public override object ProvideValue(
	IServiceProvider serviceProvider


Type: System.IServiceProvider

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

Return Value

Type: System.Object

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

Exception Condition

member value for the extension is null.


Some part of the typeName string did not parse properly.


serviceProvider did not provide a service for IXamlTypeResolver


typeName value did not resolve to a type.


serviceProvider is null

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.

.NET Framework
Available since 3.0
Return to top