Export (0) Print
Expand All

TypeExtension.ProvideValue Method

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
)

Parameters

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.

ExceptionCondition
InvalidOperationException

member value for the extension is null.

ArgumentException

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.

ArgumentNullException

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

Supported in: 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Show:
© 2014 Microsoft