This documentation is archived and is not being maintained.

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 MustOverride Function ProvideValue ( _
	serviceProvider As IServiceProvider _
) As Object
Dim instance As MarkupExtension 
Dim serviceProvider As IServiceProvider 
Dim returnValue As Object 

returnValue = instance.ProvideValue(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 Nothing 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