Rank: Newbie
Groups: Registered
Joined: 7/21/2017(UTC) Posts: 5  Location: Michigan Thanks: 1 times
|
I am trying to figure out how to only display a single page at a time and when the user scrolls using a mouse, it scrolls through full page views (Not showing partials as you scroll up).
I was advised to do this in an email "You can call ScrollToPage method or increment/decrement CurrentPageIndex property". Is there any documentation on how to actually implement that and use it for C# WPF applications.
|
|
|
|
|
|
Rank: Administration
Groups: Administrators
Joined: 1/5/2016(UTC) Posts: 1,138
Thanks: 10 times Was thanked: 133 time(s) in 130 post(s)
|
XAML: Code:
<ScrollViewer Grid.Row="1" CanContentScroll="True" VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto">
<Wpf:PdfViewer Name="pdfViewer1" ViewMode="SinglePage" SizeMode="FitToSize" MouseWheel="pdfViewer1_MouseWheel" />
</ScrollViewer>
code behind: Code:
private void pdfViewer1_MouseWheel(object sender, MouseWheelEventArgs e)
{
var doc = pdfViewer1.Document;
if (doc == null)
return;
if (e.Delta < 0 && pdfViewer1.CurrentIndex < doc.Pages.Count)
pdfViewer1.CurrentIndex++;
else if (e.Delta > 0 && pdfViewer1.CurrentIndex > 0)
pdfViewer1.CurrentIndex--;
}
|
|
|
|
|
|
Rank: Newbie
Groups: Registered
Joined: 7/21/2017(UTC) Posts: 5  Location: Michigan Thanks: 1 times
|
This worked perfectly. Thank you for your help!
|
|
|
|
|
|
Forum Jump
You can post new topics in this forum.
You can reply to topics in this forum.
You can delete your posts in this forum.
You can edit your posts in this forum.
You cannot create polls in this forum.
You can vote in polls in this forum.
Important Information:
The Patagames Software Support Forum uses cookies. By continuing to browse this site, you are agreeing to our use of cookies.
More Details
Close