Partager via


IXRDependencyObject::GetDependencyProperty(DEPENDENCY_PROPERTY_ID, XRValue*) (Compact 2013)

3/28/2014

This method retrieves the value of the specified dependency property; use it if you want to refer to the property of a custom control by its identifier.

Syntax

virtual HRESULT STDMETHODCALLTYPE GetDependencyProperty(
    __in DEPENDENCY_PROPERTY_ID id,
    __out XRValue* pValue
) = 0;

Parameters

  • id
    [in] A value that represents the identifier of the dependency property of a custom control.
  • pValue
    [out] Pointer to an XRValue object that represents the type and value of the dependency property.

Return Value

Returns an HRESULT that indicates success or failure.

Returns XR_E_INVALID_PROPERTY if this method was unable to locate the property requested.

Remarks

A dependency property is a property that depends on several other sources for its final calculated value. Several factors can influence the value of a dependency property, including the properties of related UI objects in the presentation layout.

Use this method to obtain the value of a dependency property that belongs to a custom object that you registered by using IXRApplication::RegisterXamlObject. You use RegisterXamlObject to associate a native Visual C++ object with a custom XAML element. To use this method, you need a DEPENDENCY_PROPERTY_ID to identify the dependency property. A DEPENDENCY_PROPERTY_ID value is returned when you call IXRApplication::RegisterDependencyProperty to register a dependency property after you have called IXRApplication::RegisterControl to register your custom control.

To obtain the value of a dependency property by referencing the property by name instead of its identifier, use the IXRDependencyObject::GetDependencyProperty(const WCHAR*, XRValue*) method.

To use any supported value type, such as a float value, you can use the helper template version of this method that XAML for Windows Embedded provides. When you supply a value type, this version automatically supplies a type-safe method that implicitly converts the returned type from a generic XRValue to the appropriate data type.

If you are working with an IXRCustomUserControl object, you can obtain a dependency property by using the IXRCustomUserControlBase::GetPropertyValue method.

.NET Framework Equivalent

System.Windows.DependencyObject.GetValue

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRDependencyObject::GetDependencyProperty
IXRDependencyObject
IXRDependencyObject::GetAttachedProperty