IXRApplication::RegisterDependencyProperty (Compact 7)
3/12/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.
- objectId
[in] Integer value that represents the control ID, which is retrieved by IXRApplication::RegisterControl or XRCustomUserControlImpl::ControlID.
- pMetaData
[in] XRDependencyPropertyMetaData structure that contains metadata for the dependency property.
- 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 Silverlight 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