question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Proposal: ItemsRepeater First/LastVisibleIndex

See original GitHub issue

Proposal: 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:open
  • Created 3 years ago
  • Reactions:5
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
FrayxRulezcommented, May 28, 2020

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.

1reaction
ranjeshjcommented, May 27, 2020

@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 ?

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found