enter image description here

There is a ScrollViewer, you need to implement a smooth scrolling to the bottom border, how to implement it?

Please help.

  • what does smooth scrolling mean? Why not just use ListBox? - vitidev
  • @vitidev By smooth scrolling I mean automatic scrolling to the bottom. I decided to use scrollviewer, I do not see a fundamental difference with the listbox. - Amir Ismylove
  • I do not understand your problem _scrollViewer.ScrollToVerticalOffset (_scrollViewer.ScrollableHeight); - vitidev
  • @vitidev Not that =) The focus immediately moves down, but it is necessary that the focus move in stages. - Amir Ismylove
  • Well, do a cycle from 0 to _scrollViewer.Scrollabl‌ eHeight - vitidev

1 answer 1

In general, vitidev said everything , but still add an example, smoothly scrolling content from the current location to the end:

private async Task ScrollDown() { for (var i = this.ScrollViewer1.ContentVerticalOffset; i < this.ScrollViewer1.ScrollableHeight; i++) { this.ScrollViewer1.ScrollToVerticalOffset(i); await Task.Delay(10); } } 

... where ScrollViewer1 is the name of the scroll. Call for example buttons:

 private async void ButtonTest_OnClick(object sender, RoutedEventArgs e) { await ScrollDown(); } 
  • super, what the doctor ordered! Thank! - Amir Ismylove
  • @vitidev thanks a lot! - Amir Ismylove