/// <summary> /// <inheritdoc/> /// </summary> protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) { base.OnMouseLeftButtonUp(e); _startDragPoint = new Point(-1, -1); if (e != null) { var point = e.GetPosition(this); var page = _renderedPages.FirstOrDefault(p => point.X > p.Left && point.X <p.Right && point.Y> p.Top && point.Y < p.Bottom); if (page != null) { PDFPageComponent.NavigateToPage(page.Page.PageIndex + 1); } } }
/// <summary> /// <inheritdoc/> /// </summary> protected override void OnTouchUp(TouchEventArgs e) { base.OnTouchUp(e); if (e != null) { var point = e.GetTouchPoint(this).Position; var page = _renderedPages.FirstOrDefault(p => point.X > p.Left && point.X <p.Right && point.Y> p.Top && point.Y < p.Bottom); if (page != null && _onTouchDownPage != null) { if (_onTouchDownPage.Page.PageIndex == page.Page.PageIndex) { // Navigate to this page only if touch down and up was made on the same page. PDFPageComponent.NavigateToPage(page.Page.PageIndex + 1); } } } }
/// <summary> /// <inheritdoc/> /// </summary> protected override void OnTouchUp(TouchEventArgs e) { base.OnTouchUp(e); if (e != null) { var point = e.GetTouchPoint(this).Position; var link = GetLinkOnPosition(point); if (link != null) { if (link.Action != null) { PDFPageComponent.PerformAction(link.Action); } else if (link.Destination != null) { PDFPageComponent.NavigateToDestination(link.Destination); } } } }
/// <summary> /// <inheritdoc/> /// </summary> protected override void OnMouseLeftButtonUp(MouseButtonEventArgs e) { base.OnMouseLeftButtonUp(e); _startDragPoint = new Point(-1, -1); if (e != null) { var point = e.GetPosition(this); var link = GetLinkOnPosition(point); if (link != null) { if (link.Action != null) { PDFPageComponent.PerformAction(link.Action); } else if (link.Destination != null) { PDFPageComponent.NavigateToDestination(link.Destination); } } } }
/// <summary> /// Initializes a new instance of the <see cref="BasePageLayout"/> class. /// </summary> /// <param name="pageComponent"><see cref="PDFPageComponent"/> used to obtain information.</param> /// <param name="layoutType">Type of supported layout.</param> internal BasePageLayout(PDFPageComponent pageComponent, PageLayoutType layoutType) { PageComponent = pageComponent ?? throw new ArgumentNullException(nameof(pageComponent)); LayoutType = layoutType; }
/// <summary> /// Initializes a new instance of the <see cref="StandardPageLayout"/> class. /// </summary> /// <param name="pageComponent"><see cref="PDFPageComponent"/> used to obtain information.</param> internal StandardPageLayout(PDFPageComponent pageComponent) : base(pageComponent, PageLayoutType.Standard) { }
/// <summary> /// Initializes a new instance of the <see cref="ThumbnailPageLayout"/> class. /// </summary> /// <param name="pageComponent"><see cref="PDFPageComponent"/> used to obtain information.</param> internal ThumbnailPageLayout(PDFPageComponent pageComponent) : base(pageComponent, PageLayoutType.Thumbnail) { }