TBoundPropertyBase<PropertyType,StoreType> (Compact 2013)

3/28/2014

This C++ intermediate base class represents a property in a property bag and sends notifications when the value of the property changes.

Syntax

template<typename PropertyType, typename StoreType>
class TBoundPropertyBase : public iXRPropertyBinding

Inheritance Hierarchy

iXRPropertyBinding

     TBoundPropertyBase<PropertyType,StoreType>

Parameters

  • PropertyType
    [in] Data type of the property that the class represents.
  • StoreType
    [in] Data type of the property that is stored in memory.

Members

The following tables list any methods and fields that belong to this class.

Methods

Method

Description

TBoundPropertyBase.Get

Returns the property value that is encapsulated by the TBoundPropertyBase<PropertyType,StoreType> object.

TBoundPropertyBase.Get(XRValue *)

Obtains an XRValue object that contains the value of the property in the property bag.

TBoundPropertyBase.RaisePropertyChangedEvent

Raises the PropertyChanged event for the property in the property bag.

TBoundPropertyBase.Set(const PropertyType&)

Sets the property value that is contained in the TBoundPropertyBase<PropertyType,StoreType> object.

TBoundPropertyBase.Set(XRValue *)

Sets the value of the property in the property bag by using the specified XRValue object.

TBoundPropertyBase.SetOwner(iXRPropertyBagBinding *)

Specifies the property bag that owns the property.

Fields

Field

Description

m_Value

Field that stores the value of the property. Its value type is defined in the StoreType template parameter of the class.

m_pBag

iXRPropertyBagBinding-derived object that represents the property bag that owns the property.

Thread Safety

Members of this class are not thread safe when you obtain or set its property value by using its methods. When you are accessing the value of a property, implement single threading and block other operations until the property update is complete. For example, use XRAutoCriticalSection.

Remarks

TBoundPropertyBase<PropertyType,StoreType> is an intermediate base class for template classes that represent different types of properties that you register with a property bag.

In some cases, you may want to use an object type as the data type for the property; for example, when the property represents hierarchical data in a sub-collection object. However, if you set PropertyType to an object type, this class does not provide object lifetime management. Therefore, if you use an object type, we recommend using TBoundPointerProperty<PropertyType>, which always uses a smart pointer (XRPtr<Interface>) as the StoreType.

The types specified in the PropertyType and StoreType values are identical in most cases. However, if PropertyType is a pointer or a string, StoreType can be a smart pointer type, such as XRPtr<Interface>, or the string type ce::auto_bstr that automatically allocates and releases the string in memory.

Requirements

Header

XRPropertyBag.h

See Also

Reference

Classes for Populating UI Elements with Data
TPropertyBag<Derived>
TBoundProperty<PropertyType>
TBoundProperty<BSTR>
TBoundPointerProperty<PropertyType>
IXRFrameworkElement::SetBinding