Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4537662
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T14:42:19+00:00 2026-05-21T14:42:19+00:00

I have a documentviewer which i used in my wpf project to show xps

  • 0

I have a documentviewer which i used in my wpf project to show xps document reports of having around 600 pages which is working great. But from user point of view i like to show the current page number as a tooltip on my scrollviewer while dragging the scroll stating the current page number in view. Somewhat like in a PDF file like this –

Tooltip on scrollviewer

I was looking out for some ideas how to implement this. Just a current page number if not possible to show a thumbnail image would be good enough for me.
Is there any in-built support in documentviewer for this functionality??

Thanks for any help..

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T14:42:20+00:00Added an answer on May 21, 2026 at 2:42 pm

    I cannot find anything like IsScrolling so i would approach it like this:

    <Popup Name="docPopup" AllowsTransparency="True" PlacementTarget="{x:Reference docViewer}" Placement="Center">
        <Border Background="Black" CornerRadius="5" Padding="10" BorderBrush="White" BorderThickness="1">
            <TextBlock Foreground="White">
                        <Run Text="{Binding ElementName=docViewer, Path=MasterPageNumber, Mode=OneWay}"/>
                        <Run Text=" / "/>
                        <Run Text="{Binding ElementName=docViewer, Path=PageCount, Mode=OneWay}"/>
            </TextBlock>
        </Border>
    </Popup>
    <DocumentViewer Name="docViewer" ScrollViewer.ScrollChanged="docViewer_ScrollChanged"/>
    

    The popup should be displayed when the document is scrolled, then it should fade out after some time. This is done in the handler:

    DoubleAnimationUsingKeyFrames anim;
    private void docViewer_ScrollChanged(object sender, ScrollChangedEventArgs e)
    {
        if (anim == null)
        {
            anim = new DoubleAnimationUsingKeyFrames();
            anim.Duration = (Duration)TimeSpan.FromSeconds(1);
            anim.KeyFrames.Add(new DiscreteDoubleKeyFrame(1, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(0))));
            anim.KeyFrames.Add(new DiscreteDoubleKeyFrame(1, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(0.5))));
            anim.KeyFrames.Add(new LinearDoubleKeyFrame(0, KeyTime.FromTimeSpan(TimeSpan.FromSeconds(1))));
        }
    
        anim.Completed -= anim_Completed;
        docPopup.Child.BeginAnimation(UIElement.OpacityProperty, null);
        docPopup.Child.Opacity = 1;
    
        docPopup.IsOpen = true;
    
        anim.Completed += anim_Completed;
        docPopup.Child.BeginAnimation(UIElement.OpacityProperty, anim);
    }
    
    void anim_Completed(object sender, EventArgs e)
    {
        docPopup.IsOpen = false;
    }
    

    Edit: The event fires also on scrolls done via mouse-wheel etc. you could wrap everything in the handler in if (Mouse.LeftButton == MouseButtonState.Pressed), not 100% accurate but who scrolls with the MouseWheel while left-clicking?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Crystal Reports project that I am working on where I need
I like DocumentViewer for display of an XPS document in a WPF application. But
At the moment I have a DocumentViewer in a WPF window that displays an
I have XPS files with header bookmarks. If you open the source document in
I need the DocumentViewer WPF control (for XPS files) in a Windows Form application.
I have an application that i am working on which needs actually a file
i am trying to make help for my application. I have xps documents which
In my WPF application I have a list of DocumentViewers which are bound to
I'm having a go with document viewer and XPS atm as I haven't tried
I'm building a WPF application in which I need to display document previews such

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.