public static bool MouseWithinFoldAreas(Point mousePoint, RadBookItem page) { Size foldSize = page.FoldSize; if (page.Position == PagePosition.Left) { return(FoldHelper.MouseWithinTopLeftFoldArea(mousePoint, foldSize) || FoldHelper.MouseWithinBottomLeftFoldArea(mousePoint, foldSize, page.ActualHeight)); } else { return(FoldHelper.MouseWithinTopRightFoldArea(mousePoint, foldSize, page.ActualWidth) || FoldHelper.MouseWithinBottomRightFoldArea(mousePoint, foldSize, page.ActualWidth, page.ActualHeight)); } }
public override DataTemplate SelectTemplate(object item, DependencyObject container) { RadBookItem page = container as RadBookItem; // Using the index property, we can determine whether the page is first page or it is one of the inner right pages. if (page.Index == 0) { return(this.FrontCoverTemplate); } else { return(this.RightPageTemplate); } }
public static FoldPosition GetQuadrant(Point mousePoint, RadBookItem page) { double num = page.ActualHeight / 2.0; if (page.Position == PagePosition.Left && mousePoint.Y < num) { return(FoldPosition.TopLeft); } if (page.Position == PagePosition.Left && mousePoint.Y > num) { return(FoldPosition.BottomLeft); } return(page.Position == PagePosition.Right && mousePoint.Y < num ? FoldPosition.TopRight : FoldPosition.BottomRight); }
public override DataTemplate SelectTemplate(object item, DependencyObject container) { RadBookItem page = container as RadBookItem; // we need an instance of the book so that we can determine the whether the current page is the last page. RadBook book = System.Windows.Controls.ItemsControl.ItemsControlFromItemContainer(container) as RadBook; // Using the index property, we can determine whether the page is last page or it is one of the inner left pages. if (page.Index == book.Items.Count - 1) { return(this.BackCoverTemplate); } else { return(this.LeftPageTemplate); } }
/// <summary> /// Initializes a new instance of the <see cref="T:Telerik.Windows.Controls.Book.PageMouseEventArgs"/> class. /// /// </summary> /// <param name="page">The page.</param> public PageMouseEventArgs(RadBookItem page) { this.Page = page; }
private void RadBook1_PreviewPageFlipStarted(object sender, Telerik.Windows.Controls.PageFlipEventArgs e) { RadBookItem flippedPage = e.Page; e.Handled = true; //if the page flip should stop }
private void RadBook1_PageFlipStarted(object sender, Telerik.Windows.Controls.PageFlipEventArgs e) { RadBookItem flippedPage = e.Page; }
/// <summary> /// Initializes a new instance of the <see cref="PageTurnEventArgs"/> class. /// </summary> /// <param name="source">The object that raised the event.</param> /// <param name="page">The <see cref="Telerik.Windows.Controls.Navigation.RadBookItem"/> associated with the event.</param> /// <param name="navigationDirection">Navigation direction.</param> /// <param name="routedEvent">The routed event.</param> public PageTurnEventArgs(object source, RadBookItem page, NavigationDirection navigationDirection, RoutedEvent routedEvent) : base(routedEvent, source) { this.Page = page; this.Direction = navigationDirection; }