New to Telerik UI for WPF? Download free 30-day trial

How to determine when the user has scrolled to the last page of a document in PdfViewer for WPF

Environment

Product Version 2021.3.914
Product RadPDFViewer for WPF
.Net Framework .NET Core 3.1

Description

In specific scenarios, you might need to detect when the user reached the last page of a document while scrolling through it. This can be tracked with the ValueChanged event of PdfViewer's VerticalScrollBar.

Solution

Attach to the scroll bar's ValueChanged event once the PdfViewer control is loaded and check the new value:

private void PdfViewer_Loaded(object sender, RoutedEventArgs e) 
{ 
    this.pdfViewer.VerticalScrollBar.ValueChanged += this.VerticalScrollBar_ValueChanged; 
} 
 
private void VerticalScrollBar_ValueChanged(object sender, RoutedPropertyChangedEventArgs<double> e) 
{ 
    if (e.NewValue >= this.pdfViewer.VerticalScrollBar.Maximum) 
    { 
        // The user scrolled to the end of the document.  
    } 
} 

See Also

In this article