DependencyPropertyHelper Class
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.
Provides a single helper method (GetValueSource(DependencyObject, DependencyProperty)) that reports the property system source for the effective value of a dependency property.
public ref class DependencyPropertyHelper abstract sealed
public static class DependencyPropertyHelper
type DependencyPropertyHelper = class
Public Class DependencyPropertyHelper
- Inheritance
-
DependencyPropertyHelper
Remarks
TheWPF property system is fairly complex, and relies on rationalizing the values that potentially come from a variety of inputs, based on an established value determination precedence. Because these sources potentially come from run-time code, from compiled markup, or even from run-time user settings, it can be useful to know exactly which participant in the dependency property value system established the value you obtain when calling GetValue at run-time on that property. If the value came from a different source than you had intended, you might need to adjust some aspect of your application. The value source might be a style, a theme, a local value, an animation, a binding, or a run-time based value such as system settings through themes or system resources. For more information, see Dependency Property Value Precedence.
Another mechanism that reports on the property in general, rather than a specific instance of the property on an object, is the property metadata. The property metadata is findable by calling GetMetadata and examining the returned PropertyMetadata (or one of several possible derived classes that the returned property metadata is castable to).
Methods
GetValueSource(DependencyObject, DependencyProperty) |
Returns a structure that reports various metadata and property system characteristics of a specified dependency property on a particular DependencyObject. |
IsTemplatedValueDynamic(DependencyObject, DependencyProperty) |
Indicates whether a specified element belongs to an instance of a template that defines a value for the specified property that may change at runtime based on changes elsewhere. |
Applies to
反馈
https://aka.ms/ContentUserFeedback。
即将发布:在整个 2024 年,我们将逐步淘汰作为内容反馈机制的“GitHub 问题”,并将其取代为新的反馈系统。 有关详细信息,请参阅:提交和查看相关反馈