Share via


ItemsRepeater.ElementIndexChanged Event

Definition

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

// 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;
function onElementIndexChanged(eventArgs) { /* Your code */ }
itemsRepeater.addEventListener("elementindexchanged", onElementIndexChanged);
itemsRepeater.removeEventListener("elementindexchanged", onElementIndexChanged);
- or -
itemsRepeater.onelementindexchanged = onElementIndexChanged;
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