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

  • Home
  • SEARCH
  • 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 6360431
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T23:38:56+00:00 2026-05-24T23:38:56+00:00

I created a quick example that places in image in a ScrollViewer, starts a

  • 0

I created a quick example that places in image in a ScrollViewer, starts a DispatcherTimer and then prints out the ScrollViewer.HorizontalOffset every 200 ms. From the example I noticed some strange behavior – if I grab the image and scroll around by small amounts, say 60 pixels or so, the HorizontalOffset value never changes. Is there a reason that the ScrollViewer is not reporting its position correctly?

EDIT: I also tried grabbing the ScrollBar (named “HorizontalScrollBar”) in the ScrollViewer and checking its Value property but I get the same results.

EDIT2: It appears this bug only happens on Mango build 7712 (even if the app is built for 7.0). I’ll close this out and hope that its fixed in the final build.

Sample code. On my machine I can drag the image for large extents without getting an update. I seem to only get an update ever 120 or so increments of value. I would like to get the update at least every 10-20 pixels.

<Grid x:Name="LayoutRoot" Background="Transparent">
        <ScrollViewer HorizontalScrollBarVisibility="Visible" VerticalScrollBarVisibility="Visible" x:Name="Scroll">
            <Image Source="Jellyfish.jpg" Stretch="None"/>
        </ScrollViewer>
    </Grid>

MainPage.xaml.cs:

// Constructor
        public MainPage()
        {
            InitializeComponent();

            this.Loaded += (s, e) =>
                {
                    var scrollBar = Scroll.FindVisualChild("HorizontalScrollBar") as ScrollBar;
                    scrollBar.ValueChanged += (s1, e1) => Debug.WriteLine(DateTime.Now + " " + scrollBar.Value);
                };
        }

ExtensionMethods.cs:

public static class ExtensionMethods
    {
        public static FrameworkElement FindVisualChild(this FrameworkElement root, string name)
        {
            FrameworkElement temp = root.FindName(name) as FrameworkElement;
            if (temp != null)
                return temp;

            foreach (FrameworkElement element in root.GetVisualDescendents())
            {
                temp = element.FindName(name) as FrameworkElement;
                if (temp != null)
                    return temp;
            }

            return null;
        }

        public static IEnumerable<FrameworkElement> GetVisualDescendents(this FrameworkElement root)
        {
            Queue<IEnumerable<FrameworkElement>> toDo = new Queue<IEnumerable<FrameworkElement>>();

            toDo.Enqueue(root.GetVisualChildren());
            while (toDo.Count > 0)
            {
                IEnumerable<FrameworkElement> children = toDo.Dequeue();
                foreach (FrameworkElement child in children)
                {
                    yield return child;
                    toDo.Enqueue(child.GetVisualChildren());
                }
            }
        }

        public static IEnumerable<FrameworkElement> GetVisualChildren(this FrameworkElement root)
        {
            for (int i = 0; i < VisualTreeHelper.GetChildrenCount(root); i++)
                yield return VisualTreeHelper.GetChild(root, i) as FrameworkElement;
        }
    }
  • 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-24T23:38:56+00:00Added an answer on May 24, 2026 at 11:38 pm

    The infrequent scroll event updating is part of the performance improvements in Mango:

    http://blogs.msdn.com/b/slmperf/archive/2011/06/02/listbox-scrollviewer-performance-improvement-for-mango-and-how-it-impacts-your-existing-application.aspx

    The fix is to change the ScrollViewer’s ManipulationMode as follows:

    <ListBox ItemsSource="{Binding Items}" ScrollViewer.ManipulationMode ="Control" Height="652" Canvas.Top="80">
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

On my venture for quick rendering within Flash, I've worked out that the only
quick back story-- I am working on ASP.Net based template editor that lets authors
I created a javascript file TTW for a quick fix to something i was
Does anyone have a quick example of how Associations, @NS and @NV work in
I need to migrate information that I created in SQLite3 to a MySQL database
Quick but dumb question. That kind of cascades a little bit. If I create
Just to head off the quick-repliers, I'll mention that I'm not using MySQL so
A lot of people on SO pointed out that I should use using statement
I have just a quick question: Are files created before they are finished, or
I have a quick question that's been bugging me for a while. Is it

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.