Share via


XRValueCollectionT<IFace,ItemType> (Compact 7)

3/12/2014

This C++ template class is an intermediate base class for collections of data source objects of type ItemType.

Syntax

template<typename IFace, typename ItemType>
class XRValueCollectionT : public _XRValueCollectionBaseT<IFace, ItemType, _ItemComparer, _ItemConverter, _ItemLifeManager>

Inheritance Hierarchy

_XRValueCollectionBaseT<IFace,ItemType,ItemComparer,ItemConverter,ItemLifeManager>

     XRValueCollectionT<IFace,ItemType>

Members

Template Parameters

Value Description

IFace

A Silverlight for Windows Embedded interface that the class supports.

ItemType

The class type for items in the collection.

Methods

Methods Description

XRValueCollectionT.Add(const ItemType&)

Adds an item of type ItemType to the collection.

XRValueCollectionT.Contains(const ItemType&,bool *)

Determines whether an item of type ItemType is in the collection.

XRValueCollectionT.GetItem(int,ItemType *)

Obtains the item at the specified index within the collection.

XRValueCollectionT.GetItem(int,Obj**)

Provides a type-safe version of the XRValueCollectionT.GetItem(int,ItemType *) method that obtains the item at the specified index of the collection.

XRValueCollectionT.IndexOf(const ItemType&,int *)

Determines the index of the specified item in the collection.

XRValueCollectionT.Insert(int,const ItemType&)

Inserts an item into the collection at the specified index in the collection.

XRValueCollectionT.Remove(const ItemType&)

Removes the specified item of type ItemType from the collection.

XRValueCollectionT.SetItem(int,const ItemType&)

Updates the data source object at the specified index within the collection by replacing it with a new data source object.

Thread Safety

Members of this class are not thread safe when you add, remove, update, or clear the objects in the collection. When you are updating objects with new data from the data provider, implement single-threading and block other operations until the update is finished.

Remarks

To specify the class type for items stored in the collection, set the ItemType template parameter.

Do not instantiate this class directly. Instead, instantiate a derived class that overrides the inherited Impl methods, such as XRObservableCollection<ItemType> or XRValueCollection<ItemType>.

XRValueCollection<ItemType> and XRObservableCollection<ItemType> are derived classes that you can use as the data context for an IXRItemsControl that displays dynamic data.

Requirements

Header

XRCollection.h

See Also

Reference

Classes for Populating UI Elements with Data