Proposal: ItemsRepeater First/LastVisibleIndex
See original GitHub issueProposal: ItemsRepeater First/LastVisibleIndex
Summary
ListView’s ItemsStackPanel
and ItemsWrapGrid
offer FirstVisibleIndex
and LastVisibleIndex
that can be used together with ScrollViewer.ViewChanged
to perform further actions. Would be great to have the same feature in ItemsRepeater.
Rationale
- Run hardware-intensive code only when items are actually visible (eg playing a video)
- Provide more context and a better UX to the end user (eg marking messages as read as the user scrolls a chat)
Scope
Capability | Priority |
---|---|
This proposal will allow developers to retrieve visible items in a ItemsRepeater | Must |
Important Notes
Open Questions
Issue Analytics
- State:
- Created 3 years ago
- Reactions:5
- Comments:8 (4 by maintainers)
Top Results From Across the Web
ItemsRepeater - Windows apps
ItemsRepeater is a light-weight control to generate and present a collection of items.
Read more >Items Repeater
The items repeater can display repeating data from a bound data source. It has both a layout template and a data template. ......
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I truly think that First/LastVisibleIndex or some equivalent API should be exposed directly by ItemsRepeater as it should be basically no op for it to.
@FrayxRulez I think it is good idea to have this in ItemsRepeater. We talked briefly about this in here. I’ll let @anawishnoff use either one of these proposals to track the work.
This is currently possible by looking at the layout bounds etc and calculating the first/last indices, but definitely more work than just providing it. Note that there is also the EffectiveViewportChanged event on any UIElement you can hookup that can notify the item when it comes in view which might be what you need depending on your scenario.
Can you describe how you are planning on using the APIs ?