Book Control
- 3 minutes to read
The DXBook for WPF control allows you to present data as a book. It is represented by the Book class.
Data Binding and Presentation
To display data, the DXBook needs to be bound to a data source. It can be bound to any object that implements the IEnumerable interface or its descendant (e.g., IList, ICollection). To bind the DXBook to a data source, use its Book.DataSource property.
The DXBook control doesn’t automatically present data from a bound data source. You should create a template that defines data presentation and page layout, and assign it to the Book.PageTemplate property.
Page Navigation
Pages can be accessed using index notation. The odd index corresponds to the left page, the even index corresponds to the right page, -1 corresponds to a cover. You can specify the index of the currently opened page via the Book.PageIndex property. The total number of pages in the book can be obtained using the Book.PageCount property.
The first page can be displayed on the left or right side of the book (in the second instance, the cover is displayed on the left side). To specify where the first page should be displayed, use the Book.FirstPage property.
Before a new page is opened, the Book.PageIndexChanging event is fired, allowing you to cancel turning the current page or implement custom page navigation. After a new page has been opened, the Book.PageIndexChanged event is raised.
Animation Types and Settings
The DXBook plays two types of animation: page and short animation.
Page Animation
Page animation is played when an entire page is being turned over.
Page animation speed is specified via the Book.AnimationSpeed property.
Short Animation
When an end-user hovers the mouse pointer over an active area around the page corner, the corner is automatically turned up, indicating that this page can be turned. If the mouse pointer leaves the active area, it is turned down. At that moment, the short animation is played.
Short animation speed is specified via the Book.ShortAnimationSpeed property.
Active Area
The area around page corners, over which the mouse pointer should be hovered to make the page corner turn up, is called the active area.
To change the active area’s size, use the Book.ActiveAreaSize property.
Animation Settings
Property | Description |
---|---|
Book.AnimationSpeed | Specifies the speed the page animation is played. |
Book.ShortAnimationSpeed | Specifies the speed the short animation is played. |
Book.ActiveAreaSize | Specifies the size of the active area within a page. |
Book.AnimationRate | Specifies the animation rate. |