src/controls/dev/PagerControl/readme.md
PagerControl allows developers to show items by providing an easy way to handle the user interface of pagination.
The PagerControl is structured into different multiple areas:
Both the ComboBox and NumberPanel need collections to render that are not easily created through XAML as they require some logic. To pass those collections to the visual layer, we use TemplateSettings. For performance reasons, the collections are stored inside the PagerControl and are not modified through the TemplateSettings object but rather through the reference inside the PagerControl. Since the collections on the TemplateSettings are readonly, this way of accessing is always modifying the correct items.
Below are all the named template parts of the PagerControl template. Next to them is their use case inside the control.
There are two areas of flows, 1. property changes and 2. user interactions. Every user interaction essentially only modifies a single property (generally SelectedPageIndex). Because of that, we will only discuss property change flows.
Note: Updating the TemplateSettings is done lazily, that means, we only update the collection that get's currently rendered. If we are displaying the ComboBox, we only update the ComboBox collection and if we are showing the NumberPanel, we only update the NumberPanel item collection. That's why we are updating the TemplateSettings not only when the NumberOfPages changes but also when the DisplayMode changes.
Note: If NumberOfPages is below 0, we enter "infinity mode".
Users can enter numbers as large as they want for the case of NumberBox and the NumberPanel will always allow getting the next number.
ComboBox will either show 100 items or show the last number of items when the previous value of NumberOfPages was greater than 100.
DisplayMode Auto will show a NumberBox. In "infinity mode", we do not show the last page button.
The PagerControlAutomationPeer implements the ISelectionProvider interface and raises the SelectionPatternIdentifiers::SelectionProperty changed event.
NumberBox, ComboBox and the buttons of the NumberPanel have localized UIA names provided.
The first,previous,next and last page buttons also have a localized UIA name set.
Users can use the left and right arrow keys to navigate the control.