DynamicResourceExtension.ProvideValue(IServiceProvider) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
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
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈