Navigating

In this context, navigating a view refers to managing the current item. ICollectionView not only has a CurrentItem property (and a corresponding CurrentPosition property that exposes the current item’s zero-based index), but it also has a handful of methods for programmatically changing the current item: MoveCurrentToNext, MoveCurrentToPrevious, MoveCurrentToPosition, and so on.

Although a bit wordy, these navigation methods are straightforward to use. They enable not only updating the selected item in an items control without explicitly referencing it, but any additional elements that want to display information about the current item can be automatically updated as well, as long as they bind to the same source. If you paste a second, ...

Get XAML Unleashed now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.