Acessing Objects on a Page of the book.

2 posts, 0 answers
  1. Ken
    Ken avatar
    1 posts
    Member since:
    Jan 2013

    Posted 13 Jan 2013 Link to this post

    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 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

  2. Tina Stancheva
    Tina Stancheva avatar
    3299 posts

    Posted 16 Jan 2013 Link to this post

    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.

Back to Top