This is a migrated thread and some comments may be shown as answers.

Acessing Objects on a Page of the book.

1 Answer 27 Views
Book
This is a migrated thread and some comments may be shown as answers.
Ken
Top achievements
Rank 1
Ken asked on 14 Jan 2013, 05:51 AM
Hi All,

I'm new to WPF but trying to work through this Book Control.  Could somebody please give me a quick code example on how to get access to the objects I play on the page, for example if I put a button on a page.  In vb.net code how do I get access to that object if I wanted to change its label.  I take it I need to first get the RadBookItem which should be the page I am on and then somehow use an object collection to get access to the child objects on that page but I cannot see anything like that in the intellisense for RadBookItem ?

Kind Regards

Ken

1 Answer, 1 is accepted

Sort by
0
Tina Stancheva
Telerik team
answered on 16 Jan 2013, 04:06 PM
Hi Ken,

I posted an answer in the support thread you sent but I will summarize it here as well in case anyone else encounters the same issues.

The RadBook control is essentially an ItemsControl and its items are of type RadBookItem. The RadBookItem, on the other hand is a ContentControl and you can get its content through the Content property.

The RadBook exposes an integer property indicating the index of the RadBookItem that is currently displayed as a right-side page - the RightPageIndex property. You can use this property to get both the right and the left pages currently displayed in the RadBook control through the Items or ItemsSource collections of the control - radBook.Items[radBook.RightPageIndex] (or radBook.Items[radBook.RightPageIndex]).

How to proceed after that depends on the approach used to populate the RadBook control - through declaratively defined RadBookItems or through data-binding and on the structure of each BookItem.

All the best,
Tina Stancheva
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
Book
Asked by
Ken
Top achievements
Rank 1
Answers by
Tina Stancheva
Telerik team
Share this question
or