Export (0) Print
Expand All

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


Type: System.IServiceProvider

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

Return Value

Type: System.Object
The object value to set on the property where the extension is applied.


The AssemblyName property is null. You must set this value during construction or before using the ProvideValue method.


serviceProvider is null or does not provide a service for IXamlTypeResolver.


serviceProvider specifies a target type that does not match ResourceDictionary.Source.

This method supports WPF XAML processor implementation, and is not intended to be called directly. The XAML processor 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 null. The serviceProvider object is expected to implement IXamlTypeResolver.

.NET Framework

Supported in: 4.6, 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.

© 2014 Microsoft