Share via


XRObservableCollection.OnCollectionChanged(XRCollectionChangedCustomEventArgs *) (Compact 7)

3/12/2014

This protected method raises the CollectionChanged event for the data source collection.

Syntax

HRESULT STDMETHODCALLTYPE OnCollectionChanged(
XRCollectionChangedCustomEventArgs * pArgs)

Parameters

  • pArgs
    [in] Pointer to an XRCollectionChangedCustomEventArgs that contains information about which items have changed and whether you added, removed, replaced, moved, or reset the collection.

Return Value

The following table shows the possible return values.

Value Description

S_OK

The method was successful.

E_INVALIDARG

The object sender is not valid.

Remarks

Call this method after you update the data source collection to invoke any event handlers that provide custom handling for the CollectionChanged event.

Because XRObservableCollection.OnCollectionChanged is a protected member, an instance of XRObservableCollection<ItemType> cannot directly access the XRObservableCollection.OnCollectionChanged method.

If you derive a new class from XRObservableCollection<ItemType> that uses either public or protected access modifiers, you can override this method in the new class.

Requirements

Header

XRCollection.h,
XRCustomEvent.h

See Also

Reference

XRObservableCollection<ItemType>