This documentation is archived and is not being maintained.

StaticExtension.ProvideValue Method

Returns an object value to set on the property where you apply this extension. For StaticExtension, this object value is the static value that is evaluated for the requested static member.

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

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


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 member value for the extension is null. You must set this value before a call is made to ProvideValue.


Some part of the member string did not parse properly.

- or -

serviceProvider did not provide a service for IXamlTypeResolver.

- or -

member value did not resolve to a static member.

This method supports WPF XAML processor implementation and is not intended to be called directly. The XAML processor implementation uses this method to correctly handle the x:Static extension values during object creation.

This implementation relies on services that are based on the passed serviceProviderserviceProvider must not be null. The serviceProvider object is expected to implement IXamlTypeResolver.

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

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

.NET Framework

Supported in: 3.5, 3.0