Пример #1
0
        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));
            }
        }
Пример #2
0
        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);
            }
        }
Пример #3
0
        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);
        }
Пример #4
0
        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;
 }
Пример #6
0
        private void RadBook1_PreviewPageFlipStarted(object sender, Telerik.Windows.Controls.PageFlipEventArgs e)
        {
            RadBookItem flippedPage = e.Page;

            e.Handled = true;            //if the page flip should stop
        }
Пример #7
0
 private void RadBook1_PageFlipStarted(object sender, Telerik.Windows.Controls.PageFlipEventArgs e)
 {
     RadBookItem flippedPage = e.Page;
 }
Пример #8
0
 /// <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;
 }