How To Prevent Over Scrolling in Scroll Viewer Windows Phone 8.1

309 views Asked by At

I am developing wp 8.1 app. I have a stack panel whose contents have to be added dynamically and scrolled vertically. For this, I am using Scroll Viewer outside the stack panel. Contents are scrolling fine. But, My problem is that after the last content, When I scroll, the stack panel itself get scrolled. How to prevent the stack panel to get scrolled.

Thanks in advance.

1

There are 1 answers

4
Dinesh balan On

Set the StackPanel.VerticalAlignment to Stretch and set fixed size to the parent ScrollViewer. This is necessary - the ScrollViewer must know its size, to show the scrollbars for the inner content when the inner content is too long. Otherwise It will scroll end of the control and as well as control.