Share via


IXRApplication::RegisterDependencyProperty (Compact 2013)

3/28/2014

This method registers a dependency property for a user-defined control.

Syntax

virtual HRESULT STDMETHODCALLTYPE RegisterDependencyProperty(
  __in    LPCWCHAR                        pPropertyName,
  __in    VALUE_TYPE                      vType,
  __in    UINT                            objectId,
  __in    XRDependencyPropertyMetaData*   pMetaData,
  __out   DEPENDENCY_PROPERTY_ID*        pDependencyPropertyIdentifier
) = 0;

Parameters

  • pPropertyName
    [in] Pointer to a string that contains the unique name of the dependency property.
  • vType
    [in] VALUE_TYPE enumerated type that indicates the type of property value, such as a string, integer, or object.
  • pDependencyPropertyIdentifier
    [out] DEPENDENCY_PROPERTY_ID that indicates the identifier of the dependency property.

Return Value

Returns an HRESULT that indicates success or failure.

Remarks

You can call RegisterDependencyProperty to register a new property for your custom control that will act as a dependency property in the XAML for Windows Embedded system. 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 value, such as the properties of related UI objects in the presentation layout.

You can implement a dependency property when you implement a read/write property on a custom control that derives from XRCustomUserControlImpl<Base,IFace>. To specify metadata for your dependency property, such as a default value, create an XRDependencyPropertyMetaData structure and populate it with the necessary information. Then, pass this structure into the pMetaData parameter of RegisterDependencyProperty.

.NET Framework Equivalent

System.Windows.DependencyProperty.Register

Requirements

Header

XamlRuntime.h

sysgen

SYSGEN_XAML_RUNTIME

See Also

Reference

IXRApplication
IXRApplication::RegisterAttachedProperty
IXRCustomUserControlBase::GetPropertyValue
IXRCustomUserControlBase::SetPropertyValue