Skip to content

Latest commit

 

History

History
37 lines (24 loc) · 2.36 KB

dependencyobject_getvalue_1188551207.md

File metadata and controls

37 lines (24 loc) · 2.36 KB
-api-id -api-type
M:Windows.UI.Xaml.DependencyObject.GetValue(Windows.UI.Xaml.DependencyProperty)
winrt method

Windows.UI.Xaml.DependencyObject.GetValue

-description

Returns the current effective value of a dependency property from a DependencyObject.

-parameters

-param dp

The DependencyProperty identifier of the property for which to retrieve the value.

-returns

Returns the current effective value.

-remarks

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.

-examples

-see-also

SetValue, Custom dependency properties, Dependency properties overview