I'd like to develop a simple mail client in WPF. In any mail client, part of the window is a list of messages. The usual behaviour of desktop clients such as Outlook or Thunderbird is to download every email in your inbox folder as soon as you set up your account. You might have millions of messages there, and the client will quite happily leave you waiting for hours while the messages download.
What I'd like to do is this. Given that you know how many messages are in the inbox without having to download them (which is easy in IMAP, for instance), I could fill a ListBox with placeholder items, and retrieve the corresponding message only when it comes into view.
How can I take action when an incremental set of items is scrolled into view? I came across this option in my research, but I'd like a solution that (a) allows me to identify newly visible messages incrementally rather than having to iterate over the whole set (if possible), and (b) is MVVM-friendly.