Reputation: 55
I have a ScrollViewer
and I'm filling it with controls for about 2 screen heights. At the bottom I have a button which clears the ScrollViewer
and refills it with different controls. The problem is when I refill it, the scroll distance remains where my button was. I need the ScrollViewer
to scroll up to the top. How can I do that?
Upvotes: 2
Views: 1124
Reputation: 24713
You would need to use the ScrollToVerticalOffset method of the ScrollViewer
.
myScrollViewer.ScrollToVerticalOffset(0);
Upvotes: 5