This topic has not yet been rated - Rate this topic

DynamicResourceExtension.ProvideValue Method

Returns an object that should be set on the property where this extension is applied. For DynamicResourceExtension, this is the object found in a resource dictionary in the current parent chain that is keyed by the ResourceKey.

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)
public override Object ProvideValue(
	IServiceProvider serviceProvider
)

Parameters

serviceProvider
Type: System.IServiceProvider

Object that can provide services for the markup extension.

Return Value

Type: System.Object
The object to set on the property where the extension is applied. Rather than the actual value, this will be an expression that will be evaluated at a later time.
ExceptionCondition
InvalidOperationException

Attempted to provide a value for an extension that did not provide a resourceKey.

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 DynamicResource Markup Extension values during object creation.

The property to be set by the provided value must be of type DependencyProperty.

This implementation does not rely on any services based on the passed serviceProvider.

.NET Framework

Supported in: 4.5.1, 4.5, 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows Phone 8.1, Windows Phone 8, 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.

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft. All rights reserved.