Applies to: desktop apps only
The IUICollectionChangedEvent interface is implemented by the application and defines the method required to handle changes to a collection at run time.
Members
The IUICollectionChangedEvent interface inherits from the IUnknown interface. IUICollectionChangedEvent also has these types of members:
Methods
The IUICollectionChangedEvent interface has these methods.
| Method | Description |
|---|---|
| OnChanged |
Called when an IUICollection changes. |
Remarks
The Windows Ribbon framework incorporates the standard Component Object Model (COM) client-server mechanism of connectable objects to listen for and handle collection changed events at run time.
The Ribbon acts as the COM server connectable object that defines both incoming and outgoing notification interfaces for the client, which is the Ribbon host application. The incoming interfaces are implemented by the Ribbon. The outgoing interfaces are implemented by the application in a dedicated object that is created by the application and referred to as the client connection sink. This sink is used to establish a connection to the connectable object.
In addition to defining the incoming and outgoing interfaces, the Ribbon must also implement the IConnectionPointContainer interface and create at least one connection point object that implements the IConnectionPoint interface and manages the connection with the client sink.
Note The client must query the connectable object for IConnectionPointContainer to determine whether the object is connectable before the client attempts to create a sink object.
In the case of the Ribbon, IUICollectionChangedEvent is the outgoing interface defined by the framework and implemented by the application. The Ribbon triggers the IUICollectionChangedEvent::OnChanged event in the client by sending an outgoing notification when a collection changes, for example, adding a Command to the Quick Access Toolbar (QAT).
Requirements
|
Minimum supported client | Windows 7, Windows Vista with SP2 and Platform Update for Windows Vista |
|---|---|
|
Minimum supported server | Windows Server 2008 R2, Windows Server 2008 with SP2 and Platform Update for Windows Server 2008 |
|
Header |
|
|
IDL |
|
|
DLL |
|
See also
Send comments about this topic to Microsoft
Build date: 2/15/2012
// Connection Sink for listening to collection changes
[ComImport]
[InterfaceType(ComInterfaceType.InterfaceIsIUnknown)]
[Guid("6502AE91-A14D-44b5-BBD0-62AACC581D52")]
public interface IUICollectionChangedEvent
{
[PreserveSig]
HRESULT OnChanged(UI_CollectionChange action,
UInt32 oldIndex, [MarshalAs(UnmanagedType.Interface)] object oldItem,
UInt32 newIndex, [MarshalAs(UnmanagedType.Interface)] object newItem);
}