This documentation is archived and is not being maintained.

ThemeDictionaryExtension.ProvideValue Method

Returns an object that should be set on the property where this extension is applied. For ThemeDictionaryExtension, this is the URI value for a particular theme dictionary extension.

Namespace: System.Windows
Assembly: PresentationFramework (in presentationframework.dll)

public override Object ProvideValue (
	IServiceProvider serviceProvider
public Object ProvideValue (
	IServiceProvider serviceProvider
public override function ProvideValue (
	serviceProvider : IServiceProvider
) : Object
You cannot use methods in XAML.



An object that can provide services for the markup extension. This service is expected to provide results for IXamlTypeResolver.

Return Value

The object value to set on the property where the extension is applied.

Exception typeCondition


assemblyName is a null reference (Nothing in Visual Basic). You must set this value during construction or prior to ProvideValue use.

- OR -

serviceProvider was a null reference (Nothing in Visual Basic) or did not provide a service for IXamlTypeResolver.

- OR -

serviceProvider specified a targetType other than ResourceDictionary.Source.

This method supports WPF XAML reader implementation, and is not intended to be called directly. The XAML reader implementation uses this method for proper handling of ThemeResourceDictionary extension values during object creation.

This implementation relies on services based on the passed serviceProvider. It must not be a null reference (Nothing in Visual Basic). The serviceProvider object is expected to implement IXamlTypeResolver.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0