DynamicResourceExtension.ProvideValue(IServiceProvider) 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.

 override System::Object ^ ProvideValue(IServiceProvider ^ serviceProvider);
public override object ProvideValue (IServiceProvider serviceProvider);
override this.ProvideValue : IServiceProvider -> obj
Public Overrides Function ProvideValue (serviceProvider As IServiceProvider) As Object



Object that can provide services for the markup extension.



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.


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.

Applies to