Share via


ItemsRepeater.ElementIndexChanged Event

Definition

Occurs for each realized UIElement when the index for the item it represents has changed.

This documentation applies to WinUI 2 for UWP (for WinUI in the Windows App SDK, see the Windows App SDK namespaces).

// Register
event_token ElementIndexChanged(TypedEventHandler<ItemsRepeater, ItemsRepeaterElementIndexChangedEventArgs const&> const& handler) const;

// Revoke with event_token
void ElementIndexChanged(event_token const* cookie) const;

// Revoke with event_revoker
ItemsRepeater::ElementIndexChanged_revoker ElementIndexChanged(auto_revoke_t, TypedEventHandler<ItemsRepeater, ItemsRepeaterElementIndexChangedEventArgs const&> const& handler) const;
public event TypedEventHandler<ItemsRepeater,ItemsRepeaterElementIndexChangedEventArgs> ElementIndexChanged;
Public Custom Event ElementIndexChanged As TypedEventHandler(Of ItemsRepeater, ItemsRepeaterElementIndexChangedEventArgs) 

Event Type

Remarks

When you use ItemsRepeater to build a more complex control that supports specific interactions on the child elements (such as selection or click), it is useful to be able to keep an up-to-date identifier for the backing data item.

This event is raised for each realized UIElement where the index for the item it represents has changed. For example, when another item is added or removed in the data source, the index for items that come after in the ordering will be impacted.

Applies to