I have an ItemsRepeater. I know I can get all of the elements with ItemsRepeater.ItemsSourceView, but how can I figure out which ones are realized (and not virtualized) (e.g., for focusing the right-most realized item)?
Is the only way to iterate through the list with ItemsRepeater.TryGetElement and see what returns non-null?
You can't do this statically (i.e. ask "at the given moment, which elements are realized?") beyond the
TryGetElementapproach mentioned in the question.Alternative: book-keeping
Have you tried the ItemsRepeater's Lifecycle Events?
ElementPrepared occurs each time an element is made ready for use. This occurs for both a newly created element as well as an element that already exists and is being re-used from the recycle queue.
ElementClearing occurs immediately each time an element has been sent to the recycle queue, such as when it falls outside the range of realized items.
Check this sample code: