編輯

共用方式為


DynamicResourceExtension.ProvideValue(IServiceProvider) Method

Definition

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.

public:
 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

Parameters

serviceProvider
IServiceProvider

Object that can provide services for the markup extension.

Returns

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.

Exceptions

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

Remarks

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