DependencyObject.GetValue(DependencyProperty) Method
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 the current effective value of a dependency property from a DependencyObject.
public:
virtual Platform::Object ^ GetValue(DependencyProperty ^ dp) = GetValue;
IInspectable GetValue(DependencyProperty const& dp);
public object GetValue(DependencyProperty dp);
function getValue(dp)
Public Function GetValue (dp As DependencyProperty) As Object
The DependencyProperty identifier of the property for which to retrieve the value.
Returns the current effective value.
GetValue obtains the current effective value of a dependency property. The current effective value is determined by using rules of Dependency properties overview.
GetValue is the API you want in most cases if you are using the property system API for obtaining property values. But sometimes you might want to examine other values to see how the dependency property precedence is acting for a given property. If so, you can use one of these API:
- GetAnimationBaseValue to get values that might currently be animated but you want to know the value before the animation ran. Note that animations with HoldEnd behavior might not have this same value. For more info on the HoldEnd concept, see Storyboarded animations.
- ReadLocalValue to get the local value, which does not have styles or templates or animations applied. Bindings do count as local values, but depending on when you call ReadLocalValue, the acting binding context might not be available yet, so you won't get the same value as would be applied at run time. For more info on dependency property precedence and other property system utility API, see Dependency properties overview.
Product | Versions |
---|---|
WinRT | Build 10240, Build 10586, Build 14383, Build 15063, Build 16299, Build 17134, Build 17763, Build 18362, Build 19041, Build 20348, Build 22000, Build 22621, Build 26100 |