DependencyPropertyHelper Class

Provides a single helper method (GetValueSource) that reports the property system source for the effective value of a dependency property.

System.Object
  System.Windows.DependencyPropertyHelper

Namespace:  System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)

public static class DependencyPropertyHelper

The DependencyPropertyHelper type exposes the following members.

  NameDescription
Public methodStatic memberGetValueSourceReturns a structure that reports various metadata and property system characteristics of a specified dependency property on a particular DependencyObject.
Top

The WPF 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).

.NET Framework

Supported in: 4, 3.5, 3.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft