ProvideValue Method
Collapse the table of content
Expand the table of content

MarkupExtension.ProvideValue Method

When implemented in a derived class, returns an object that is set as the value of the target property for this markup extension.

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

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


Type: System.IServiceProvider

Object that can provide services for the markup extension.

Return Value

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

Notes to Implementers:

Common services returned by existing markup extensions include IProvideValueTarget and IXamlTypeResolver.

Implementations of this method can ignore the serviceProvider parameter, but must also expect null values in this case.

Implementations that require a certain service to return a value are expected to raise exceptions if that service is not available.

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

Community Additions

© 2015 Microsoft