Method OnItemInserted
OnItemInserted(object?, int, MenuItem)
Invoked after an item has been inserted into the collection.
protected override void OnItemInserted(object? sender, int index, MenuItem item)
Parameters
senderobjectThe source of the event, typically the collection that triggered the insertion.
indexintThe zero-based index at which the item was inserted.
itemMenuItemThe item that was inserted into the collection.
Remarks
This method is called to notify derived classes of an item insertion. Subclasses can override this method to perform custom logic in response to the insertion.