PageContainer
A PageContainer
control is an onscreen element that provides a way to implement linear navigation between pages of content, such as in a document, book, notepad, or calendar. Pages fluidly scroll from one to the next or turn like pages in a physical book.
Best practices
When a PageContainer
is used, pages flow sequentially and there’s no way to jump between nonadjacent pages. If people may need to access pages out of sequence in your app, implement a custom control that provides this functionality.
How to use
- Drop a
PageContainer
control from the object panel to aWindow
- Use the
PageContainer Inspector
to customize its Navigation style properties likeDataSet
,Style
and its Page Curl properties likeStyle
The inspector where the PageContainer
class can be configured.
Example
- Drop a
PageContainer
control from the object panel to aWindow
- Create a DataSet of pictures by dropping images in the Project -> Assets folder
- Set the
PageContainer
DataSet property to Asset; now you can test the pages transition by tapping Play - Drop an
ImageView
and aLabel
onto thePageContainer
->CustomView1
. The ending hierarchy should look like
- Navigation1
- Window1
- PageContainer1
- CustomView1
- ImageView1
- Label1
- Select
CustomView1
and tap the Custom Properties button on the Inspector topbar. - Right click and select New Property
- Add a property named "Image" and bind it to ImageView1.image
- Add a property named "Label" and bind it to Label1.text
- Open the
PageContainer
inspector and select Cell Properties - Assign to Label the value Name
- Assign to Image the value Image
- Tap Play to see how the
PageContainer
content is now rendered with the Assets image and name - Swipe to scroll
Most important properties
Several aspects can be configured in the PageContainer
class but the most important are:
DataSet
: To set the content source for thePageContainer
Style
: PageCurl for turning pages like a book, PageScroll to fluidly scroll from one to the next page
References
PageContainer class reference contains a complete list of properties and methods that can be used to customize a PageContainer
object.